home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / helppc.zip / C.TXT < prev    next >
Text File  |  1990-11-27  |  165KB  |  5,915 lines

  1. @C Programming Topics
  2. :c declarations
  3. ^Complex C Declarations
  4.  
  5.  
  6.  int i;              i as an int
  7.  int *i;             i as a pointer to an int
  8.  int **i;            i is a pointer to a pointer to an int
  9.  int *(*i)();        i is a pointer to a function returning a
  10.                        pointer to int
  11.  int *(*i[])();      i is an array of pointers to functions
  12.                        returning pointers to an int
  13.  int *i[5];          i is an array of 5 pointers to int
  14.  int (*i)[5];        i is a pointer to an array of 5 ints
  15.  int *i();           i is a function returning a pointer to an int
  16.  int (*i)();         i is a pointer to a function returning int
  17.  int *(*(*i)())[5]   i is a pointer to a function returning a
  18.                        pointer to an array of 5 pointers to an int
  19.  
  20.  
  21. :c errors (msc):msc errors
  22. ^Microsoft C Compiler Fatal Errors
  23.  
  24.  C1000  unknown fatal error; contact Microsoft
  25.  C1001  internal compiler error; contact Microsoft
  26.  C1002  compiler out of heap space in C2.EXE
  27.  C1003  error count exceeded; stopping compilation
  28.  C1004  unexpected end-of-file found; disk full or unmatched #if
  29.  C1005  string too big for buffer
  30.  C1006  compiler intermediate file create/write error
  31.  C1007  invalid option on compiler command line
  32.  C1008  no source file specified
  33.  C1009  macros nested too deeply
  34.  C1010  macro expansion exceeded available space
  35.  C1011  macro definition too large
  36.  C1012  unmatched parenthesis in preprocessor directive
  37.  C1014  nesting of #include's exceed 10-level nesting limit
  38.  C1016  #ifdef & #ifndef directives expect an identifier
  39.  C1018  unexpected #elif;  #elif without #if directive
  40.  C1019  unexpected #else;  #else without #if directive
  41.  C1020  unexpected #endif;  #endif without #if directive
  42.  C1021  invalid preprocessor command
  43.  C1022  expected #endif;  #if directive not terminated by #endif
  44.  C1023  can't open specified source file
  45.  C1024  can't open specified include file
  46.  C1026  parser stack overflow; module too complex
  47.  C1027  DGROUP default data allocation exceeds 64K
  48.  C1028  modules far data segment allocation exceeds 64K (QC)
  49.  C1031  function calls nested too deeply
  50.  C1032  can't open object listing file
  51.  C1033  can't open assembly language output file
  52.  C1035  expression too complex; must be simplified
  53.  C1036  can't open source listing file
  54.  C1037  can't open object file
  55.  C1039  unrecoverable heap overflow in Pass 3 (post-optimizer)
  56.  C1040  unexpected EOF in source file; file disappeared
  57.  C1041  can't open intermediate file; no free file handles
  58.  C1042  can't open intermediate file; invalid TMP environment var
  59.  C1043  can't open intermediate file; unknown error
  60.  C1044  no disk space available for intermediate file
  61.  C1047  compiler option was specified too many times
  62.  C1048  unknown option specified
  63.  C1049  invalid numerical argument
  64.  C1050  code segment too large; within 36 bytes of 64K
  65.  C1052  #if/#ifdef nested too deeply;  max of 32 levels
  66.  C1053  struct/union nested too deeply; max of 15
  67.  C1054  initializers nested too deeply; max from 10 to 15 levels
  68.  C1055  out of keys; file has too many symbols
  69.  C1056  out of macro expansion space; macro to large/complex
  70.  C1057  unexpected EOF in macro expansion or missing ')'
  71.  C1059  compiler has run out of near heap space
  72.  C1060  compiler has run out of far heap space
  73.  C1062  error writing preprocessor output file for /P option
  74.  C1063  compiler stack overflow; module too complex
  75.  C1064  identifier too long causing token to overflow internal buffer
  76.  C1068  can't open file specified file
  77.  C1069  file write error on specified file; disk space low
  78.  C1070  mismatched #if/#endif pair; missing #endif
  79.  C1071  unexpected EOF found in comment; missing end of comment
  80.  C1072  can't read indicated file
  81.  C1090  data allocation exceeds 64K on _based allocation
  82.  C1015  can't open include file (check name, searchpath and FILES=)
  83.  C1126  automatic allocation (local variable) exceeds size
  84.  C1127  segment redefinition; overwritten by specified segment
  85.  
  86. ^Microsoft C Compiler Nonfatal Errors
  87.  
  88.  C2015  too many characters in constant; escape sequence too large
  89.  C2016  missing closing single quotation mark on code line
  90.  C2017  illegal escape sequence; occurred outside of string
  91.  C2018  unknown character found in source file
  92.  C2019  expected preprocessor directive; # followed by non-directive
  93.  C2021  expected exponent value but found non-numeric character
  94.  C2022  octal value following '\' is too large for a single character
  95.  C2025  given identifier redefines enum, struct or union tag
  96.  C2026  given identifier already used as enum constant
  97.  C2027  given identifier refers to undefined enum, struct or union
  98.  C2028  struct/union member needs to be inside a struct/union
  99.  C2030  identifier used more than once in struct or union tag
  100.  C2031  function can't be use as struct or union member
  101.  C2033  bit field can't be declared as a pointer or use indirection
  102.  C2034  type of host bit field is too small for number of bits
  103.  C2035  given structure or union has undefined size
  104.  C2037  undefined struct or union identifier on left of -> or .
  105.  C2038  identifier is not a struct or union member
  106.  C2055  expected formal-parameter list instead of argument-type list
  107.  C2056  illegal expression; possibly from previous unreported problem
  108.  C2057  expected constant expression
  109.  C2058  expected integral constant expression
  110.  C2059  invalid token caused a syntax error
  111.  C2060  syntax error; EOF found before expected token
  112.  C2061  identifier caused syntax error
  113.  C2062  unexpected type
  114.  C2063  identifier is not a function but used as such
  115.  C2064  term does not evaluate to a function pointer
  116.  C2065  identifier not defined
  117.  C2066  illegal cast to function type
  118.  C2067  illegal cast to array type
  119.  C2068  illegal cast type used in expression
  120.  C2069  cast of void term to non-void is invalid
  121.  C2070  illegal sizeof operand; must be expression or type name
  122.  C2071  illegal storage class for identifier
  123.  C2072  attempt to initialize a function identifier
  124.  C2092  arrays of functions illegal; use array of ptrs to function
  125.  C2093  can't use address of auto variable as static initializer
  126.  C2094  label was undefined in function
  127.  C2095  void argument cannot be passed to function; (void *) may
  128.  C2096  struct & union comparison is illegal; compare members
  129.  C2097  illegal initialization
  130.  C2098  expected address as initialization expression
  131.  C2099  non-constant initializer
  132.  C2100  illegal indirection; * applied to a non-pointer value
  133.  C2101  address of operator '&' used on constant; requires lvalue
  134.  C2102  address of operator '&' requires lvalue
  135.  C2103  address of operator '&' can't be used on a register variable
  136.  C2104  address of operator '&' used on bit field not allowed
  137.  C2105  operator needs lvalue
  138.  C2106  left side of an operation must be lvalue
  139.  C2107  subscript applied to expression didn't evaluate to pointer
  140.  C2108  non-integral expression used as array subscript
  141.  C2109  subscript used on non-array variable
  142.  C2127  allocation for function parameters exceeds 32K
  143.  C2128  array crosses 2 segments & element size not power of 2
  144.  C2129  static function referenced was never defined
  145.  C2130  #line expected string containing file name; found other
  146.  C2131  more than one memory attribute applied to and identifier
  147.  C2132  syntax error : unexpected identifier
  148.  C2133  attempt to declare an unsized array as a local variable
  149.  C2134  struct or union too large; exceeded 64k
  150.  C2136  prototype must have a valid type for each variable
  151.  C2137  use of empty character constant '' is illegal
  152.  C2139  more than one type used in a variable declaration
  153.  C2140  argument can't be a function
  154.  C2141  enum constant value out of int range
  155.  C2143  expected 'token1' before 'token2' or missing ')', '}' or ';'
  156.  C2144  expected 'token' before 'type' or missing ')', '}' or ';'
  157.  C2145  expected 'token' before identifier or declaration missing ';'
  158.  C2146  expected 'token' before identifier
  159.  C2147  increment of index or array pointer with unknown base type
  160.  C2162  token following stringizing operator # isn't formal parameter
  161.  C2163  function in pragma not available as intrinsic function
  162.  C2164  intrinsic function not declared before use wit /Oi option
  163.  C2165  _pascal, _cdecl, _???? keywords can't modify pointers to data
  164.  C2166  attempt to modify item declared as const; lvalue is constant
  165.  C2167  too many parameters in call to an intrinsic function
  166.  C2168  too few parameters in call to an intrinsic function
  167.  C2169  function definition for function already declared intrinsic
  168.  C2170  intrinsic pragma used for function without intrinsic form
  169.  C2171  unary operator used on illegal operand type
  170.  C2172  non-pointer argument passed to a function expecting pointer
  171.  C2173  non-pointer argument passed to a function expecting pointer
  172.  C2174  cant pass parameter with void type to function
  173.  C2176  static huge data not supported by /qc; use halloc()
  174.  C2177  constant too large for data type
  175.  C2178  storage class for same_seg pragma variables must be extern
  176.  C2179  same_seg pragma variable class has changed from extern
  177.  C2207  middle member of struct/union has zero-sized array
  178.  C2208  enum, struct or union defined w/o members using /Za option
  179.  C2209  type cast used in _based construct must be (_segment)
  180.  C2210  base in _based declarator must be near/far data pointer
  181.  C2211  item cast in _based declarator can't be a function
  182.  C2212  _based not available for functions or pointers to functions
  183.  C2213  symbol used as base must be type _segment, near far pointer
  184.  C2214  _based pointer based on void can't be de-referenced; use :>
  185.  C2215  :> operator only for objects based on void
  186.  C2216  given function attributes are incompatible
  187.  C2217  function attribute requires another attributes also
  188.  C2218  type in _based construct must be void
  189.  C2219  const/volatile appeared where type or qualifier not allowed
  190.  C2220  no object file generated; warning treated as error due to /WX
  191.  C2221  left operand of '.' is pointer to struct/union, must use '->'
  192.  C2222  left operand of '->' is struct or union, must use '.'
  193.  C2223  left operand of '->' must be pointer struct or union
  194.  C2411  identifier is not a member of the specified struct or union
  195.  C2412  identifier redefined within current function
  196.  C2413  alignment size used with ALIGN directive missing or invalid
  197.  C2414  illegal number of operands in assembly code; see /G1 & /G2
  198.  C2415  improper operand type
  199.  C2416  illegal opcode for processor in assembly code; see /G1 & /G2
  200.  C2417  divisor used within the given context is zero
  201.  C2418  in-line asm identifier referenced as register and isn't
  202.  C2419  divisor argument to mod is zero in given context
  203.  C2420  given identifier is illegal in this context
  204.  C2421  PTR must not be used with register operand in this context
  205.  C2422  illegal segment override used in given context
  206.  C2424  given token used to form improper expression in this context
  207.  C2425  token used fto form non-constant expression in this context
  208.  C2426  given token is illegal operator in this context
  209.  C2427  jump referencing label is out of range
  210.  C2429  FAR PTR can't be use on jmp or call to label
  211.  
  212. ^Microsoft C Command-Line Errors
  213.  
  214.  D2000  unknown CL command line error; contact Microsoft
  215.  D2001  too many symbols predefined with /D; max is 30
  216.  D2002  memory-model specification conflict; only 1 allowed
  217.  D2003  missing source file name for CL command
  218.  D2008  option specified too many times
  219.  D2011  more than one /FP option specified; only 1 allowed
  220.  D2012  too many linker flags in command; max of 128 flags/files
  221.  D2013  incomplete model specification in /A:
  222.  D2018  can't open linker response file
  223.  D2019  can't overwrite source with object file; output = input
  224.  D2020  /Gc requires extended keywords be enabled via /Ze
  225.  D2021  invalid numerical argument; numeric args must be < 65534
  226.  D2022  can't open help file for /HELP
  227.  D2027  CL could not execute one of the compiler components
  228.  D2028  too many open files; can't dup/redirect specified stream
  229.  D2030  internal compiler component error; contact Microsoft
  230.  D2031  too many flags/files in command; max of 128 arguments to CL
  231.  
  232. ^Microsoft C Command-Line Warning
  233.  
  234.  D4000  unknown command line warning in CL; contact Microsoft
  235.  D4001  listing overrides assembly output; /Fc and /Fa used together
  236.  D4002  unknown flag ignored by CL command
  237.  D4003  multiple processors selected for code generation
  238.  D4005  CL could not locate compiler component
  239.  D4007  /C must be used in conjunction with /P or /E or /EP
  240.  D4009  threshold valid for far/huge data models only; /Gt ignored
  241.  D4011  preprocessor listing specified; source listing not generated
  242.  D4012  function prototyping specified; source listing not generated
  243.  D4013  combined listing /Fc overrides object listing /Fl
  244.  D4014  invalid value for option; default  value used
  245.  D4018  .DEF files supported in OS/2 only (/Lr /Lc)
  246.  D4019  string too long for /ND, /NT, /NM, /St, /Ss option of CL
  247.  
  248. ^Microsoft Link Errors (incomplete list)
  249.  
  250.  L2002  fixup overflow (probably incompatible memory models .OBJs)
  251.  
  252. ^Microsoft C Floating-Point Math Errors
  253.  
  254.  M6101  invalid operation occurred; usually NAN or infinity problem
  255.  M6102  denormal; significance loss with very small generated number
  256.  M6103  attempt to divide by zero in floating-point operation
  257.  M6104  overflow in floating-point operation
  258.  M6105  underflow occurred in floating-point operation
  259.  M6106  inexact; loss of precision occurred in FP operation
  260.  M6107  unemulated/unsupported 8087/287/387 instruction executed
  261.  M6108  square root operand somehow became negative; C won't allow
  262.  M6110  coprocessor or emulator stack overflow
  263.  M6111  stack underflow due to unretrieved double return values
  264.  
  265. ^Microsoft C Run-Time Errors
  266.  
  267.  R6000  stack overflow; stack needs enlarged or problem program
  268.  R6001  null pointer assignment, NULL segment modified
  269.  R6002  floating-point support not linked into executable
  270.  R6005  not enough memory to load child process (EXEC)
  271.  R6006  target executable is not a valid executable (EXEC)
  272.  R6007  invalid environment on exec of child process (EXEC)
  273.  R6008  not enough space for argument vector after program loads
  274.  R6009  not enough space for environment after program loads
  275.  R6010  abnormal program termination
  276.  R6012  illegal null near-pointer use
  277.  R6013  illegal out of range far-pointer use
  278.  R6016  not enough space for thread data
  279.  R6017  unexpected multithread lock error
  280.  
  281. :cl:msc options
  282. ^Microsoft C Options (v6.0)
  283.  
  284. %CL [options] [filenames] [libraries link-options]
  285.  
  286.  /AT        Tiny Memory Model; combined code and data limited to 64K
  287.  /AS        Small Memory Model; code and data limited to 64K each
  288.  /AM        Medium Memory Model; data is limited to 64K
  289.  /AC        Compact Memory Model; code is limited to 64K
  290.  /AL        Large Memory Model; unlimited code and data but arrays
  291.             are limited to 64K
  292.  /AH        Huge Memory Model; unlimited code, data and array size
  293.  /Astring   where string is compose of the following:
  294.  
  295. %           Code Pointer Control
  296.             s   all code pointers are near
  297.             l   all code pointers are far
  298.  
  299. %           Data Pointer Control
  300.             n   all data pointers are near
  301.             f   all data pointer are far
  302.             h   all data pointers are huge
  303.       
  304. %           Segment Setup Control
  305.             d   stack segment (SS) defaults to data segment (DS)
  306.             u   stack segment (SS) is not equal to data segment (DS);
  307.                 DS is loaded on function entry
  308.             w   stack segment (SS) is not equal to data segment (DS);
  309.                 DS is NOT loaded on function entry
  310.  
  311.  /B1[path]  used to invoke the large version of the compiler C1L.EXE;
  312.             normally used when the compiler runs out of heap space
  313.  /B2        invokes large compiler version pass 2
  314.  /B3        invokes large compiler version pass 3
  315.  /C         preserves file comments when preprocessing a file
  316.  /c         do not link, create .OBJ file only
  317.  /D<string> defines string as a preprocessor constant.  If string is
  318.             of the form "ID=xxx" then "ID" represents the value "xxx"
  319.             If no equals sign is present, "ID" has the value 0.  If
  320.             an equals sign is present without a value, ID has the
  321.             value 1.
  322.  /E         output from preprocessor is written to stdout with
  323.             interspersed #line directives.
  324.  /EP        output from preprocessor is written to stdout without,
  325.             adding #line directives.
  326.  /F<size>   sets stack to <size> bytes.  Size must be hexadecimal.
  327.  /Fa[file]  generate assembly listing.  Filename defaults to source
  328.             file with .ASM extension.
  329.  /Fb<file>  creates bound executable.  Should be used only with /Lp.
  330.  /Fc[file]  generates combined assembly/source listing.  The filename
  331.             defaults to the source file name with the .COD extension.
  332.  /Fe<file>  creates the executable with specified name
  333.  /Fl[file]  generates object code listing.   Default file name is the
  334.             source file name with a .COD extension.
  335.  /Fm[file]  generate a link MAP file.  Default file name is the source
  336.             file name with the extension .MAP.
  337.  /Fo<file>  generate and object file using the name <file>.
  338.  /FPa       generates floating point calls and selects the alternate
  339.             math library.
  340.  /FPc       generates floating point calls and selects the emulation
  341.             library.
  342.  /FPc87     generates floating point calls and selects the 80x87
  343.             library.
  344.  /FPi       generates inline 80x87 instructions and selects the 80x87
  345.             library.  Default floating point option.
  346.  /FPi87     generates floating point calls and selects the 80x87
  347.             library.
  348.  /Fr[file]  generates a standard PWB Source Browser Database.  The
  349.             default name is the source file with the .SBR extension.
  350.  /FR[file]  generates a standard PWB Source Browser Database.  The
  351.             default name is the source file with the .SBR extension.
  352.  /Fs        generate a source file listing with .LST extension.
  353.  /Fx        generate a cross reference listing with .CRF extension.
  354.  /G0        generate code using 8088/8086 instruction set
  355.  /G1        generate code using 80188/80186 instruction set
  356.  /G2        generate code using 80286 instruction set
  357.  /Gc        generate code using FORTRAN/PASCAL calling and naming
  358.             conventions
  359.  /Gd        generate code using standard C calling and naming
  360.             conventions (default)
  361.  /Ge        generate code using stack checking routines (default)
  362.  /Gi        incremental compile if used with /qc; only functions that
  363.             have changed are compiled;  implies /Li option
  364.  /Gm        strings are generated in the CONST segment
  365.  /Gr        _fastcall functions are enabled.   Parameters can be
  366.             passed via registers instead of on the stack
  367.  /Gs        suppress generation of stack checking code
  368.  /Gt[num]   places data items larger than "num" bytes into different
  369.             segments. The default value for "num is 256 bytes.
  370.  /Gw        generate Windows functions entry/exit code
  371.  /GW        generates more efficient Windows functions entry/exit
  372.             code.  Use /Gw for callback routines.
  373.  /H<num>    external name length restriction (default 31)
  374.  /HELP      calls QuickHelp utility.  /help is also valid.
  375.  /I<path>   inserts <path> in front of current include search path
  376.  /J         all chars should be unsigned (default is signed)
  377.  /Lc        linker is to generate compatibility mode programs.
  378.  /Li[num]   incremental link using ILINK instead of LINK.  Results
  379.             in larger EXE size.
  380.  /Lp        linker is to generate protected mode executable.
  381.  /Lr        linker is to create real mode executable.
  382.  /link <info> passes library names in <info> to LINK
  383.  /MA<opt>   passes <opt> to MASM if .ASM files found on command line
  384.  /MD        creates Dynamic Link Library for OS/2;  The same as:
  385.             /ALw /FPi /G2 /DDLL /DMT.   No library search record is
  386.             defined
  387.  /ML        links the C run-time library as part of the Dynamic Link
  388.             Library.  The library search record is set to LLIBCDLL.LIB.
  389.             
  390.  /MT        enable multithread program support in OS/2
  391.  /ND<dseg>  set data segment name to <dseg>
  392.  /NM<name>  set module name to <name>
  393.  /nologo    suppress sign-on banner display
  394.  /NT<name>  set code segment name to <name>
  395.  /O[opts]   where "opts" is a string containing the following:
  396.  
  397.             a   relax alias checking
  398.             c   enable block level local common expressions
  399.             d   disable all optimizations
  400.             e   enable global register optimization
  401.             g   enable global optimizations and global common
  402.                 expressions
  403.             i   enable generation of intrinsic functions
  404.             l   enable loop optimization
  405.             n   disable unsafe loop optimization (default)
  406.             p   improve consistency in floating-point calculations
  407.             r   disable inline returns from functions
  408.             s   optimize for size
  409.             t   optimize for speed (default)
  410.             w   assume no aliasing except across function calls
  411.             x   maximize optimization (/Ocegilt/Gs)
  412.             z   enable maximum loop and global-register allocation
  413.                 optimization
  414.  
  415.  /P         preprocess source generating .I intermediate file
  416.  /qc        quick compile option.  Incompatible with the following
  417.             options: /Fa /Fc /Fl /FPa /FPc /FPc87 /Fs /Gm /H /Ow /Zc
  418.  /Sl<wid>   set listing file line width to <wid> (79-132, default 79)
  419.  /Sp<len>   set page length  (15-255, default 63)
  420.  /Ss<stitle> set source listing subtitle
  421.  /St<title> set source listing title
  422.  /Ta<file>  <file> is to be treated as an assembler source file
  423.             regardless of the file extension
  424.  /Tc<file>  <file> is to be treated as an C source file regardless
  425.             of the file extension
  426.  /u         undefines all predefined indentifiers
  427.  /U<id>     undefines <id> predefined indentifier
  428.  /V<ver>    version string <ver> is copied to the .OBJ file
  429.  /w         suppress compiler warnings (same as /W0)
  430.  /W0        suppress compiler warnings
  431.  /W<n>      warning level (1..4) 1=fewer, 4=more warnings (default 1)
  432.  /WX        all warnings should be treated as fatal
  433.  /X         ignore standard places in include path search
  434.  /Za        disables Microsoft language extensions insuring ANSI
  435.             code compatibility
  436.  /Zc        pascal functions are to be case insensitive
  437.  /Zd        generate line number information for debuggers
  438.  /Ze        enable Microsoft C language extensions
  439.  /Zg        generate function prototypes and display via stdout
  440.             without compiling.
  441.  /Zi        generate symbolic debugging information
  442.  /Zl        suppress library search record generation
  443.  /Zp1       structures are not to be packed (Turbo C default)
  444.  /Zp2       pack structure on word boundaries
  445.  /Zp4       pack structure on dword boundary
  446.  /Zr        generate code to check null pointers and out of range
  447.             far pointers
  448.  /Zs<file>  perform syntax check only
  449.  
  450. %Environment Variables
  451.  
  452.  CL         default input files and command line options
  453.  INCLUDE    paths to search for include files (separated by ";")
  454.  LIB        paths to search for library files (separated by ";")
  455.  LINK       command line options for link
  456.  TMP        path where temporary files are created
  457. :c escape sequences
  458. ^C Escape Sequences
  459.  
  460.        \a     Bell
  461.        \b     Backspace
  462.        \f     Form feed
  463.        \n     Line feed
  464.        \r     Carriage return
  465.        \t     Horizontal tab
  466.        \v     Vertical tab
  467.        \'     Single quote
  468.        \"     Double quote
  469.        \\     Backslash
  470.        \0     NULL character
  471.        \7     Bell
  472.        \ddd   Octal value
  473.        \xddd  Hexadecimal value
  474.  
  475. :c operators:operator precedence
  476. ^C Operators
  477.  
  478. %  Operation         C Operator            Associativity
  479.  
  480.  Array                   []                   ( ── )
  481.  Function                ()                   ( ── )
  482.  Member                  ->                   ( ── )
  483.  Member                  .                    ( ── )
  484.  
  485.  Unary minus             -                    ( ── )
  486.  Unary plus              +                    ( ── )
  487.  Logical NOT             !                    ( ── )
  488.  Bitwise compliment      ~                    ( ── )
  489.  Address of              &                    ( ── )
  490.  Indirection             *                    ( ── )
  491.  Sizeof                  sizeof               ( ── )
  492.  Increment               ++                   ( ── )
  493.  Decrement               --                   ( ── )
  494.  Cast                    (type)               ( ── )
  495.  
  496.  Multiplication          *                    ( ── )
  497.  Division                /                    ( ── )
  498.  Modulus                 %                    ( ── )
  499.  
  500.  Addition                +                    ( ── )
  501.  Subtraction             -                    ( ── )
  502.  
  503.  Shift right             >>                   ( ── )
  504.  Shift left              <<                   ( ── )
  505.  
  506.  Greater than            >                    ( ── )
  507.  Greater or equal        >=                   ( ── )
  508.  Less than               <                    ( ── )
  509.  Less or equal           <=                   ( ── )
  510.  
  511.  Equal                   ==                   ( ── )
  512.  Not equal               !=                   ( ── )
  513.  
  514.  Bitwise AND             &                    ( ── )
  515.  
  516.  Bitwise XOR             ^                    ( ── )
  517.  
  518.  Bitwise OR              |                    ( ── )
  519.  
  520.  Logical AND             &&                   ( ── )
  521.  
  522.  Logical OR              ||                   ( ── )
  523.  
  524.  Conditional             ?:                   ( ── )
  525.  
  526.  Simple assignment       =                    ( ── )
  527.  Addition assignment     +=                   ( ── )
  528.  Subtraction assignment  -=                   ( ── )
  529.  Multiplication assign   *=                   ( ── )
  530.  Division assignment     \=                   ( ── )
  531.  Modulus assignment      %=                   ( ── )
  532.  Left shift assignment   <<=                  ( ── )
  533.  Right shift assignment  >>=                  ( ── )
  534.  Bitwise XOR assignment  ^=                   ( ── )
  535.  Bitwise AND assignment  &=                   ( ── )
  536.  Bitwise OR assignment   |=                   ( ── )
  537.  Compliment assignment   ~=                   ( ── )
  538.  
  539.  Sequence operator       ,                    ( ── )
  540.  
  541.  
  542.  - all operations grouped together have the same precedence
  543. :regs:byteregs:wordregs:sregs:regpack
  544. ^Register Structures for Turbo C and MS C
  545.  
  546. %        Turbo C                      MS C
  547.  
  548. %struct WORDREGS              struct WORDREGS
  549.     {                            {
  550.     unsigned int ax;             unsigned int ax;
  551.     unsigned int bx;             unsigned int bx;
  552.     unsigned int cx;             unsigned int cx;
  553.     unsigned int dx;             unsigned int dx;
  554.     unsigned int si;             unsigned int si;
  555.     unsigned int di;             unsigned int di;
  556.     unsigned int cflag;          unsigned int cflag;
  557.     unsigned int flags;          };
  558.     };
  559.  
  560. %struct BYTEREGS
  561.     {
  562.     unsigned char al;
  563.     unsigned char ah;
  564.     unsigned char bl;
  565.     unsigned char bh;          ─  same as Turbo C
  566.     unsigned char cl;
  567.     unsigned char ch;
  568.     unsigned char dl;
  569.     unsigned char dh;
  570.     };
  571.  
  572. %union REGS
  573.     {
  574.     struct   WORDREGS x;       ─  same as Turbo C
  575.     struct   BYTEREGS h;
  576.     };
  577.  
  578. %struct SREGS
  579.     {
  580.     unsigned int es;
  581.     unsigned int cs;           ─  same as Turbo C
  582.     unsigned int ss;
  583.     unsigned int ds;
  584.     };
  585.  
  586. %struct REGPACK
  587.     {
  588.     unsigned r_ax;
  589.     unsigned r_bx;
  590.     unsigned r_cx;
  591.     unsigned r_dx;
  592.     unsigned r_bp;               Turbo C only
  593.     unsigned r_si;
  594.     unsigned r_di;
  595.     unsigned r_ds;
  596.     unsigned r_es;
  597.     unsigned r_flags;
  598.     };
  599.  
  600.  
  601. :abort
  602. ^void abort( void )
  603.  
  604.  
  605.  - prototype in stdlib.h & process.h
  606.  
  607.  - terminates a process & calls exit(3)
  608.  
  609. :abs
  610. ^int abs( int n )
  611.  
  612.  
  613.  - prototype in stdlib.h
  614.  
  615.  - returns the absolute value of int n
  616.  
  617. :absread
  618. ^TC: int absread( int drive, int count, int start, void *buffer )
  619.  
  620.  
  621.  - prototype in dos.h
  622.  
  623.  - reads absolute logical disk sectors
  624.  - drive = (0=A:, 1=B:, 2=C:, ...)
  625.  - count = # of sectors to read
  626.  - start = beginning logical sector number
  627.  - buffer = address of buffer
  628.  - TC++ accounts for DOS 4.x+ long sector values while TC 2.0 and
  629.    earlier do not (see INT 25)
  630.  - returns 0 if OK; -1 on error; errno has DOS error number
  631.  
  632.  - see   INT 25
  633.  
  634. :abswrite
  635. ^TC: int abswrite( int drive, int sectors, int start, void *buffer )
  636.  
  637.  
  638.  - prototype in dos.h
  639.  
  640.  - writes absolute logical disk sectors
  641.  - drive =  (0=A:, 1=B:, 2=C:, ...)
  642.  - sectors = # of sectors to write
  643.  - start = beginning logical sector number
  644.  - buffer = address of buffer
  645.  - TC++ accounts for DOS 4.x+ long sector values while TC 2.0 and
  646.    earlier do not (see INT 25)
  647.  - returns 0 if OK; -1 on error; errno has DOS error number
  648.  
  649.  - see   INT 25
  650.  
  651. :access
  652. ^int access( const char *filename, int amode )
  653.  
  654.  
  655.  - prototype in io.h
  656.  
  657.  - checks filename for existence & R/W access
  658.  
  659.  - amode = 06 -- check for R/W permission
  660.            04 -- check for R
  661.            02 -- check for W
  662.            01 -- execute (ignored)
  663.            00 -- check if filename exists
  664.  
  665.  - filename can be directory
  666.  - returns 0 if OK
  667.           -1 on error
  668.              errno = ENOENT if path or filename not found
  669.              errno = EACCES if permission denied
  670.  
  671. :acos
  672. ^double acos( double x )
  673.  
  674.  
  675.  - prototype in math.h
  676.  
  677.  - returns arc cosine of x
  678.  - values must be in range -1 to 1
  679.  
  680. :alloca
  681. ^MSC: void *alloca( size_t size )
  682.  
  683.  
  684.  - prototype in malloc.h
  685.  
  686.  - allocates size bytes for the application stack
  687.  - memory is automatically freed upon exiting the calling function
  688.  - this function cannot be used as a parameter to another function
  689.    or stack corruption will occur
  690.  - the pointer returned CANNOT be passed as an argument to free()
  691.    since it isn't allocated from DOS
  692.  - see   stackavail
  693.  
  694. :allocmem
  695. ^TC: int allocmem( unsigned size, unsigned *seg )
  696.  
  697.  
  698.  - prototype in dos.h
  699.  
  700.  - allocates memory in size paragraphs, where seg is pointer to
  701.    a word containing segment address
  702.  - returns -1 if ok, else largest available memory in paragraphs
  703.  - MS C uses _dos_allocmem
  704.  - see  INT 21,48
  705.  
  706. :asctime
  707. ^char *asctime( const struct tm *tm )
  708.  
  709.  
  710.  - prototype in time.h
  711.  
  712.  - converts time in struct tm to 26-character ASCII string
  713.  - returns a pointer to the ASCII string
  714.  
  715. :asin
  716. ^double asin( double x )
  717.  
  718.  
  719.  - prototype in math.h
  720.  
  721.  - returns arc sine of x
  722.  - values must be in range -1 to 1
  723.  
  724. :assert
  725. ^void assert( int test )
  726.  
  727.  
  728.  - prototype in assert.h
  729.  
  730.  - if test fails, prints error message & aborts program
  731.  - test can be a condition
  732.  
  733. :atan
  734. ^double atan( double x )
  735.  
  736.  
  737.  - prototype in math.h
  738.  
  739.  - returns arc tangent of x
  740.  
  741. :atan2
  742. ^double tan( double y, double x )
  743.  
  744.  
  745.  - prototype in math.h
  746.  
  747.  - returns arc tangent of x*2
  748.  - used instead of atan when the resulting angle is near
  749.    pi/2 or -pi/2
  750.  
  751. :atexit
  752. ^int atexit( void func )
  753.  
  754.  
  755.  - prototype in stdlib.h
  756.  
  757.  - func is defined as void (*func)(void)
  758.  - calls func() before exiting to DOS
  759.  - up to 32 functions can be called (if 32 atexit calls registered)
  760.  - should be located in main & executed before anything else
  761.  - returns 0 if OK, else nonzero if no space to register function
  762.  
  763. :atof
  764. ^double atof( const char *s )
  765.  
  766.  
  767.  - prototype in math.h & stdlib.h
  768.  
  769.  - converts ASCII string to double value
  770.  
  771. :atoi
  772. ^int atoi( const char *s )
  773.  
  774.  
  775.  - prototype in stdlib.h
  776.  
  777.  - converts ASCII string to integer value
  778.  
  779. :atol
  780. ^long atol( const char *s )
  781.  
  782.  
  783.  - prototype in stdlib.h
  784.  
  785.  - converts ASCII string to long value
  786.  
  787. :bdos
  788. ^int bdos( int dosfun, unsigned dosdx, unsigned dosal )
  789.  
  790.  
  791.  - prototype in dos.h
  792.  
  793.  - make DOS system call for function dosfun, passing DX and AL
  794.    values via dosdx and dosal
  795.  - use only in small memory model
  796.  - unique to DOS
  797.  - returns value of AX set by system call
  798.  
  799. :bdosptr
  800. ^TC: int bdosptr( int dosfun, void *argument, unsigned dosal )
  801.  
  802.  
  803.  - prototype in dos.h
  804.  
  805.  - make DOS system call for function dosfun, passing POINTER
  806.    to values via argument and passing AL via dosal
  807.  - use for small or large memory models
  808.  - returns value of AX set by system call, else -1 on failure
  809.    (where errno & _doserrno are then set)
  810.  
  811. :_bfree:_ffree:_nfree
  812. %  MSC: void _bfree( _segment seg, void _based(void) *block )
  813. %  MSC: void _ffree( void far *block )
  814. %  MSC: void _nfree( void near *block )
  815.  
  816.  
  817.  - prototype in malloc.h
  818.  
  819.  - block = previously allocated buffer
  820.  - in large data memory models free() maps to _ffree()
  821.  - in small data memory models free() maps to _nfree()
  822.  - NULL pointer parameter is ignored
  823.  
  824. :_bios_disk
  825. ^MSC: unsigned _bios_disk(unsigned cmd,struct diskinfo_t *dskinfo)
  826.  
  827.  
  828.  - prototype in bios.h
  829.  
  830.  - cmd = _DISK_RESET   resets disk system  (INT 13,0)
  831.        = _DISK_STATUS  return disk status  (INT 13,1)
  832.        = _DISK_READ    read disk sectors  (INT 13,2)
  833.        = _DISK_WRITE   write disk sectors  (INT 13,3)
  834.        = _DISK_VERIFY  verify disk sectors  (INT 13,4)
  835.        = _DISK_FORMAT  format disk track  (INT 13,5)
  836.  - dskinfo = pointer to structure containing disk information:
  837.  
  838.  struct diskinfo_t
  839.     {
  840.     unsigned drive;     /* physical drive number */
  841.     unsigned head;      /* head number */
  842.     unsigned track;     /* track number */
  843.     unsigned sector;    /* sector number */
  844.     unsigned nsectors;  /* sectors to deal with */
  845.     void _far *buffer;  /* data buffer */
  846.     };
  847.  
  848.  - returns status of operation (AX register, AH contains status)
  849.  - drive numbers represent physical drives (0 = A:, 1 = B:,
  850.    80h = drive 0, 81h = drive 1
  851.  - disk reads should be retried at least 3 times
  852.  - Turbo C uses biosdisk()
  853.  
  854.  - see  INT 13
  855.  
  856. :_bios_equiplist
  857. ^MSC: unsigned _bios_equiplist( void )
  858.  
  859.  
  860.  - prototype in bios.h
  861.  
  862.  - returns flags found in BIOS data area at 40:10 & 40:11
  863.  - Turbo C uses biosequip()
  864.  - see  INT 11
  865.  
  866. :_bios_keybrd
  867. ^MSC: int _bios_keybrd( int cmd )
  868.  
  869.  
  870.  - prototype in bios.h
  871.  
  872.  - cmd = _KEYBRD_READ   return next keystroke w/o echo (INT 16,0)
  873.        = _KEYBRD_READY  test if key avail; 0=none  (INT 16,1)
  874.        = _KEYBRD_SHIFTSTATUS  return shift key status (INT 16,2)
  875.        = _NKEYBRD_READ   return next keystroke w/o echo (INT 16,10)
  876.        = _NKEYBRD_READY  test if key avail; 0=none  (INT 16,11)
  877.        = _NKEYBRD_SHIFTSTATUS return shift key status (INT 16,12)
  878.  
  879.  - AND returned value with 0x00FF to get ASCII value
  880.  - Ctrl-Break causes "while (!_bios_keybrd(_KEYBRD_READY))" to loop
  881.    infinitely since it places a zero in the keyboard queue
  882.  - _NKEYBRD_READ, _NKEYBRD_READY, _NKEYBRD_SHIFTSTATUS are available
  883.    on AT and newer machines only
  884.  - Turbo C uses bioskey()
  885.  - see  INT 16
  886.  
  887. :_bios_memsize
  888. ^MSC: unsigned _bios_memsize( void )
  889.  
  890.  
  891.  - prototype in bios.h
  892.  
  893.  - returns memory size in 1K blocks (16..640K)
  894.  - Turbo C uses biosmemory()
  895.  - see  INT 12
  896.  
  897. :_bios_printer
  898. %unsigned _bios_printer(unsigned cmd,unsigned port,unsigned data)
  899.  
  900.  
  901.  - prototype in bios.h
  902.  
  903.  - cmd = _PRINTER_WRITE  print character  (INT 17,0)
  904.        = _PRINTER_INIT  initialize printer port  (INT 17,1)
  905.        = _PRINTER_STATUS  read port status  (INT 17,2)
  906.  - port = printer port;  0=LPT1, 1=LPT2
  907.  - data = value to write
  908.  
  909.  - returns status of printer (INT 17, AX reg, AH contains status)
  910.  - Turbo C uses biosprint()
  911.  - see  INT 17
  912.  
  913. :_bios_serialcom
  914. ^MSC: unsigned _bios_serialcom(unsigned cmd,unsigned port,unsigned fmt)
  915.  
  916.  - prototype in bios.h
  917.  
  918.  - cmd = _COM_INIT  initialize port  (INT 14,0)
  919.        = _COM_SEND  send character  (INT 14,1)
  920.        = _COM_RECEIVE  read character from port  (INT 14,2)
  921.        = _COM_STATUS  get serial port status  (INT 14,3)
  922.  
  923.  - fmt = combination of the following:
  924.          _COM_CHR7          _COM_CHR8
  925.          _COM_STOP1         _COM_STOP2
  926.          _COM_NOPARITY      _COM_EVENPARITY       _COM_ODDPARITY
  927.          _COM_110           _COM_150              _COM_300
  928.          _COM_600           _COM_1200             _COM_2400
  929.          _COM_4800          _COM_9600
  930.  
  931.  - returns status word (INT 14, AX reg, modem status in AL,
  932.    port status in AH)
  933.  - Turbo C uses bioscomm()
  934.  - see  INT 14
  935. :_bios_timeofday
  936. ^MSC: unsigned _bios_timeofday( unsigned cmd, long *timeval )
  937.  
  938.  
  939.  - prototype in bios.h
  940.  
  941.  - cmd = _TIME_GETCLOCK  get real time clock  (INT 1A,0)
  942.        = _TIME_SETCLOCK  set real time clock  (INT 1A,1)
  943.  
  944.  - returns current BIOS clock count
  945.  - Turbo C uses biostime()
  946.  - see  INT 1A
  947.  
  948. :bioscom
  949. ^TC: int bioscom( int cmd, char byte, int port )
  950.  
  951.  - prototype in bios.h
  952.  
  953.  - RS232 communications
  954.  
  955.  - cmd = 0 to set comm parms to value in byte
  956.          1 to send char in byte out on RS232 line
  957.          2 to receive char
  958.          3 to return current port status
  959.  
  960.  - port = 0 for COM1
  961.           1 for COM2
  962.           2 for COM3
  963.           3 for COM4
  964.  
  965.  - byte = bitwise OR of following bits
  966.           0x02 = 7 data bits    0x00 = 1 stop bit
  967.           0x03 = 8 data bits    0x04 = 2 stop bits
  968.           0x00 == no parity;
  969.           0x08 == odd parity;
  970.           0x18 == even parity
  971.  
  972.           0x00     110 bps       0x20     150 bps
  973.           0x40     300 bps       0x60     600 bps
  974.           0x80     1200 bps      0xa0     2400 bps
  975.           0xc0     4800 bps      0xe0     9600 bps
  976.  
  977.  - returns 16-bit integer, upper 8 bits are status & lower 8 bits
  978.    depending on cmd sent
  979.  - see INT 14 and subfunctions for more information
  980.  
  981.  
  982.    │7│6│5│4│3│2│1│0│  low byte (AL)  modem status
  983.     │ │ │ │ │ │ │ └──── delta clear to send
  984.     │ │ │ │ │ │ └───── delta data set ready
  985.     │ │ │ │ │ └────── trailing edge ring detector
  986.     │ │ │ │ └─────── delta receive line signal detect
  987.     │ │ │ └──────── clear to send
  988.     │ │ └───────── data set ready
  989.     │ └────────── ring indicator
  990.     └─────────── receive line signal detect
  991.  
  992.    │F│E│D│C│B│A│9│8│  high byte (AH)  line status
  993.     │ │ │ │ │ │ │ └──── data ready
  994.     │ │ │ │ │ │ └───── overrun error
  995.     │ │ │ │ │ └────── parity error
  996.     │ │ │ │ └─────── framing error
  997.     │ │ │ └──────── break detect
  998.     │ │ └───────── transmit holding register empty
  999.     │ └────────── transmit shift register empty
  1000.     └─────────── time out
  1001.  
  1002.  - MS C uses _bios_serialcomm()
  1003.  
  1004. :biosdisk
  1005. %  TC: int biosdisk( int cmd, int drive, int head, int track,
  1006. %                    int sector, int nsects, void *buffer )
  1007.  
  1008.  - prototype in bios.h
  1009.  
  1010.  - issues interrupt 0x13 for BIOS disk operations
  1011.  - drive = (0=A:, 1=2nd floppy, 0x80=drive 0, 0x81=drive 1
  1012.  - cmd = 0  reset diskette system (hard disk drive reset)
  1013.          1  return status of last disk operation, ignore parms
  1014.          2  read nsects disk sectors, with starting sector
  1015.             defined by head, track, & sector, reading 512 bytes
  1016.             per sector into buffer
  1017.          3  write nsects disk sectors, with starting sector
  1018.             defined by head, track, & sector, writing 512 bytes
  1019.             per sector from buffer
  1020.          4  verify nsects disk sectors, with starting sector
  1021.             defined by head, track, & sector
  1022.          5  format a track defined by head & track, where buffer
  1023.             points to a table of sector headers to be written
  1024.  
  1025.   For XT or AT only:
  1026.  
  1027.      6 - formats a track & sets bad sector flags
  1028.      7 - formats drive beginning at specific track
  1029.      8 - returns current drive parms in 1rst 4 bytes of buffer
  1030.      9 - initializes drive-pair characteristics
  1031.     10 - long read (4 extra bytes per sector for ECC)
  1032.     11 - long write (4 extra bytes per sector for ECC)
  1033.     12 - disk seek
  1034.     13 - alternate disk reset
  1035.     14 - reads sector buffer
  1036.     15 - writes sector buffer
  1037.     16 - tests if named drive is ready
  1038.     17 - recalibrates drive
  1039.     18 - controller ram diagnostic
  1040.     19 - drive diagnostic
  1041.     20 - controller internal diagnostic
  1042.  
  1043.  - see (int 13) for more return codes and more information
  1044.  - drive numbers represent physical drives (0 = A:, 1 = B:,
  1045.    80h = drive 0, 81h = drive 1
  1046.  - disk reads should be retried at least 3 times
  1047.  - MS C uses _bios_disk()
  1048.  
  1049. :biosequip
  1050. ^TC: int biosequip( void )
  1051.  
  1052.  
  1053.  - prototype in bios.h
  1054.  
  1055.  - returns integer showing equipment in system
  1056.  - see (INT 11 or EQUIPMENT FLAGS) for bit meanings
  1057.  - MS C uses _bios_equiplist()
  1058.  
  1059. :bioskey
  1060. ^TC: int bioskey( int cmd )
  1061.  
  1062.  
  1063.  - prototype in bios.h
  1064.  
  1065.  - keyboard operations
  1066.  - cmd = 0  return next keystroke w/o echo  (INT 16,0)
  1067.        = 1  test if key waiting;  0=none  (INT 16,1)
  1068.        = 2  return shift key status  (see INT 16,2)
  1069.  
  1070.  
  1071.  - AND returned value with 0x00FF to get ASCII value
  1072.  - Ctrl-Break causes "while (!bioskey(1))" to loop infinitely since
  1073.    it places a zero in the keyboard queue
  1074.  - MS C uses _bios_keybrd()
  1075.  - see also INT 16
  1076.  
  1077. :biosmemory
  1078. ^TC: int biosmemory( void )
  1079.  
  1080.  
  1081.  - prototype in bios.h
  1082.  
  1083.  - returns BIOS size memory in 1K blocks
  1084.  - see also INT 12
  1085.  - MS C uses _bios_memsize()
  1086.  
  1087. :biosprint
  1088. ^TC: int biosprint( int cmd, int byte, int port )
  1089.  
  1090.  - prototype in bios.h
  1091.  
  1092.  - outputs byte to port
  1093.  - port = 0 (LPT1)
  1094.           1 (LPT2), etc...
  1095.  - cmd = 0 (print byte);
  1096.          1 (init printer port);
  1097.          2 (get LPT status)
  1098.  
  1099.  - returns status of (values are or'd flags):
  1100.    0x01 time out (cmd=0 means output error)
  1101.    0x08 I/O error
  1102.    0x10 selected
  1103.    0x20 out of paper
  1104.    0x40 acknowledge
  1105.    0x80 not busy
  1106.  
  1107.  - see  INT 17h
  1108.  - MS C uses _bios_printer()
  1109. :biostime
  1110. ^TC: int biostime( int cmd, long newtime )
  1111.  
  1112.  
  1113.  - prototype in bios.h
  1114.  
  1115.  - reads or sets BIOS timer
  1116.  - cmd = 0  returns current value of timer
  1117.          1  sets timer to value of newtime
  1118.  - MS C uses _bios_timeofday()
  1119.  
  1120. :_bmalloc:_fmalloc:_nmalloc
  1121. %MSC: void _based(void) *_bmalloc( _segment seg, size_t size )
  1122. %MSC: void far *_fmalloc( size_t size )
  1123. %MSC: void near *_nmalloc( size_t size )
  1124.  
  1125.  
  1126.  - prototype in malloc.h
  1127.  
  1128.  - size = number of bytes to allocate
  1129.  - seg = base segment value
  1130.  - malloc() maps to _fmalloc or _nmalloc based on memory model
  1131.  - _fmalloc allocates memory outside the default data segment if
  1132.    possible
  1133.  - returns pointer to allocated block or NULL on error;  _bmalloc()
  1134.    function returns _NULLOFF on error
  1135.  - these functions will allocate a zero length block
  1136.  
  1137. :brk
  1138. ^int brk( void *endds )
  1139.  
  1140.  
  1141.  - prototype in alloc.h (malloc.h for MS C)
  1142.  
  1143.  - dynamically changes the amount of space allocated to the calling
  1144.    programs data segment.  Amount of allocated space increases as
  1145.    the break value increases.
  1146.  - returns 0 if OK
  1147.           -1 with errno set to ENOMEM
  1148.  
  1149. :bsearch
  1150. %void *bsearch( void *key, void *base, int nelem, int width,
  1151. %               int (*fcmp )())
  1152.  
  1153.  - prototype in stdlib.h
  1154.  
  1155.  - does binary search for items in a table which is
  1156.    ALREADY sorted in ascending order
  1157.  - base points to 0th element of table
  1158.  - nelem contains number of entries in table
  1159.  - width contains number of bytes in each entry
  1160.  - key points to the search key
  1161.  
  1162.  - fcmp() points to comparison routine, where key and elem are
  1163.    passed to it as pointers.  Function fcmp() returns:
  1164.  
  1165.        integer < 0 if search key < elem;
  1166.        integer = 0 if equal;
  1167.        returns > 0 if search key > elem
  1168.  
  1169.  - returns 0 if no match found, else address of first
  1170.    entry that matches
  1171.  
  1172. :cabs
  1173. ^double cabs( struct complex z )
  1174.  
  1175.  
  1176.  - prototype in math.h
  1177.  
  1178.  - returns absolute value of int n
  1179.  
  1180. :calloc
  1181. ^void *calloc( unsigned count, unsigned sizeeach )
  1182.  
  1183.  
  1184.  - prototype in stdlib.h & alloc.h (malloc.h for MS C)
  1185.  
  1186.  - allocates main memory
  1187.  - see malloc
  1188.  
  1189. :ceil
  1190. ^double ceil( double x )
  1191.  
  1192.  
  1193.  - prototype in math.h
  1194.  
  1195.  - rounds up x
  1196.  
  1197. :cgets
  1198. ^char *cgets( char *s )
  1199.  
  1200.  
  1201.  - prototype in conio.h
  1202.  
  1203.  - reads string from console
  1204.  - CR/LF combination is replaced by \0
  1205.  - before calling, s[0] should be the max length of string to input
  1206.  - on return, s[1] contains the actual string length
  1207.  - returns pointer to s[2], the actual data input
  1208.  
  1209. :_chain_intr
  1210. ^MSC: void _chain_intr( void (interrupt far *target)() )
  1211.  
  1212.  
  1213.  - prototype in dos.h
  1214.  
  1215.  - chains from one interrupt handler to another;  sets up the
  1216.    stack as if the interrupt was called directly by pushing the
  1217.    flags and the original return address on the stack
  1218.  - this function does not return to caller but returns to the
  1219.    code where the interrupt occurred
  1220.  - no corresponding function in Turbo C
  1221.  
  1222. :chdir
  1223. ^int chdir( const char *path )
  1224.  
  1225.  
  1226.  - prototype in dir.h
  1227.  
  1228.  - changes current working directory to path.
  1229.  - returns 0 if OK; else -1 with errno set to ENOENT
  1230.  
  1231. :_chmod
  1232. ^TC: int _chmod( const char *filename, int func [,int attrib] )
  1233.  
  1234.  
  1235.  - prototype in io.h, also include dos.h
  1236.  
  1237.  - if func = 0, returns access mode of file
  1238.  - if func = 1, sets access mode of file
  1239.  - attrib can be one of the following:
  1240.  
  1241.              Turbo C         MSC
  1242.             FA_RDONLY     _A_RDONLY
  1243.             FA_HIDDEN     _A_HIDDEN
  1244.             FA_SYSTEM     _A_SYSTEM
  1245.  
  1246.  
  1247.  - if func = 1,
  1248.     returns 0 if OK
  1249.            -1 with errno set to ENOENT or EACCES
  1250.  
  1251.  - if func = 0, returns MSDOS attribute
  1252.  
  1253. :chmod
  1254. ^int chmod( const char *filename, int permiss)
  1255.  
  1256.  
  1257.  - prototype in io.h, also include stat.h
  1258.  
  1259.  - changes access mode of file according to mask given by permiss,
  1260.    where permiss is:
  1261.  
  1262.         S_IWRITE
  1263.         S_IREAD
  1264.         S_IWRITE | S_IREAD
  1265.  
  1266.  - returns 0 if OK
  1267.           -1 with errno set to ENOENT or EACCES
  1268.  
  1269. :_clear87
  1270. ^unsigned int _clear87( void )
  1271.  
  1272.  
  1273.  - prototype in float.h
  1274.  
  1275.  - clears 8087/80287 status word & other exceptions
  1276.  - returns old status word
  1277.  - see _status87
  1278.  - for MSC also see  _control87
  1279.  
  1280. :clearerr
  1281. ^void clearerr( FILE *stream )
  1282.  
  1283.  
  1284.  - prototype in stdio.h
  1285.  
  1286.  - resets error indication
  1287.  - see ferror()
  1288.  
  1289. :_clearscreen
  1290. ^MSC: void far _clearscreen( short target )
  1291.  
  1292.  
  1293.  - prototype in graph.h
  1294.  
  1295.  - target = _GCLEARSCREEN  clears screen
  1296.           = _GVIEWPORT  clears current viewport
  1297.           = _GWINDOW  clears current text window
  1298.  - available in graphics mode only
  1299.  - clears target area by filling with current background color
  1300.  
  1301. :clock
  1302. ^MSC: clock_t clock( void )
  1303.  
  1304.  
  1305.  - prototype in time.h
  1306.  
  1307.  - returns elapsed processor time used by the calling process,
  1308.    or -1 on error
  1309.  
  1310. :_close
  1311. ^TC: int _close( int fd )
  1312.  
  1313.  
  1314.  - prototype in io.h
  1315.  
  1316.  - closes file fd where fd is file handle from _creat(), creat(),
  1317.    creatnew(), creattemp(), dup(), dup2(), _open(), or open().
  1318.  - use fdopen() to change file handle to file stream.
  1319.  - does not write a CTL-Z to a text file on closing
  1320.  - returns 0 if OK;  -1 & errno=EBADF
  1321.  - see  INT 21,3E
  1322.  - MS C uses _dos_close()
  1323.  
  1324. :close
  1325. ^int close( int fd )
  1326.  
  1327.  
  1328.  - prototype in io.h
  1329.  
  1330.  - closes file fd where fd is file handle from _creat(), creat(),
  1331.    creatnew(), creattemp(), dup(), dup2(), _open(), or open()
  1332.  - use fdopen() to change file handle to file stream
  1333.  - does not write a CTL-Z to a text file on closing
  1334.  - returns 0 if OK; else -1 & errno may be set of EBADF
  1335.  
  1336. :_control87
  1337. ^MSC: unsigned _control87( unsigned new, unsigned mask )
  1338.  
  1339.  - prototype in float.h
  1340.  
  1341.  - used to change floating point handling and exception masking
  1342.  - new = contains corresponding bit values for any bit set in "mask"
  1343.          to be moved into the coprocessor control word
  1344.  - mask = zero; gets floating-point coprocessor control word
  1345.         = non-zero; if any bit is set, the corresponding bit in
  1346.           "new" is moved into the coprocessor control word
  1347.  - returns floating-point coprocessor control word
  1348.  - default control word is the logical OR of: IC_AFFINE, RC_NEAR,
  1349.    PC_64, EM_DENORMAL, EM_UNDERFLOW, EM_INEXACT
  1350.  
  1351.  
  1352. %Control Word Mask and Bits
  1353.  
  1354.  MCW_EM   interrupt exception control
  1355.  MCW_IC   infinity control
  1356.  MCW_RC   rounding control
  1357.  MCW_PC   precision control
  1358.  
  1359. %Exception Masks
  1360.  
  1361.  EM_INVALID     invalid
  1362.  EM_DENORMAL    denormal
  1363.  EM_ZERODIVIDE  zero divide
  1364.  EM_OVERFLOW    overflow
  1365.  EM_UNDERFLOW   underflow
  1366.  EM_INEXACT     inexact (precision)
  1367.  
  1368. %Infinity Control
  1369.  
  1370.  IC_AFFINE      affine
  1371.  IC_PROJECTIVE  projective
  1372.  
  1373. %Rounding Control
  1374.  
  1375.  RC_CHOP   truncate
  1376.  RC_UP     round up
  1377.  RC_DOWN   round down
  1378.  RC_NEAR   near
  1379.  
  1380. %Precision Control
  1381.  
  1382.  PC_24   24 bits precision
  1383.  PC_53   53 bits precision
  1384.  PC_64   64 bits precision
  1385.  
  1386. %User Status Word Bits
  1387.  
  1388.  SW_INVALID    invalid
  1389.  SW_DENORMAL   denormal
  1390.  SW_ZERODIVIDE zero divide
  1391.  SW_OVERFLOW   overflow
  1392.  SW_UNDERFLOW  underflow
  1393.  SW_INEXACT    inexact precision
  1394.  
  1395. %Invalid Subconditions (if SW_INVALID)
  1396.  
  1397.  SW_UNEMULATED     unemulated instruction
  1398.  SW_SQRTNEG        square root of a neg number
  1399.  SW_STACKOVERFLOW  FP stack overflow
  1400.  SW_STACKUNDERFLOW FP stack underflow
  1401.  
  1402. %Floating Point Errors
  1403.  
  1404.  FPE_INVALID
  1405.  FPE_DENORMAL
  1406.  FPE_ZERODIVIDE
  1407.  FPE_OVERFLOW
  1408.  FPE_UNDERFLOW
  1409.  FPE_INEXACT
  1410.  FPE_UNEMULATED
  1411.  FPE_SQRTNEG
  1412.  FPE_STACKOVERFLOW
  1413.  FPE_STACKUNDERFLOW
  1414.  FPE_EXPLICITGEN
  1415.  
  1416.  - see   _clear87   _status87
  1417.  
  1418. :coreleft
  1419. %        TC: unsigned coreleft( void )
  1420. %        TC: unsigned long coreleft( void )
  1421.  
  1422.  
  1423.  - prototype in alloc.h
  1424.  
  1425.  - returns a measure of unused memory (see malloc())
  1426.  - return value is int for models tiny, small, medium
  1427.    return value is long for models compact, large, huge
  1428.  - no corresponding function in MS C
  1429. :cos
  1430. ^double cos( double x )
  1431.  
  1432.  
  1433.  - prototype in math.h
  1434.  
  1435.  - returns the cosine of angle x
  1436.  - x must be in radians
  1437.  
  1438. :cosh
  1439. ^double cosh( double x )
  1440.  
  1441.  
  1442.  - prototype in math.h
  1443.  
  1444.  - returns the hyperbolic cosine of angle x
  1445.  - x must be in radians
  1446.  
  1447. :country
  1448. ^TC: struct country *country(int cntrycode,struct country *cntryp)
  1449.  
  1450.  
  1451.  - prototype in dos.h
  1452.  
  1453.  - returns country-dependent information
  1454.  
  1455. :cprintf
  1456. ^int cprintf( char *format [, argument,...] )
  1457.  
  1458.  
  1459.  - prototype in conio.h
  1460.  
  1461.  - sends formatted output to the console
  1462.  - TC use either direct memory writes or BIOS calls depending on the
  1463.    value of the external integer directvideo
  1464.  - see  PRINTF SPEC  for format specifications
  1465.  
  1466. :cputs
  1467. ^void cputs( char *s )
  1468.  
  1469.  
  1470.  - prototype in conio.h
  1471.  
  1472.  - writes string s to console
  1473.  - TC: uses either direct memory writes or BIOS calls depending
  1474.    on the value of the extern directvideo
  1475.  
  1476. :_creat
  1477. ^TC: int _creat( const char *fname, int attr )
  1478.  
  1479.  
  1480.  - prototype in io.h, also include dos.h
  1481.  
  1482.  - creates new file (overwrites existing file) of filename with file
  1483.    attribute attr, for both read/write
  1484.  - attr can be a combination of the following
  1485.  
  1486.    FA_RDONLY   set read only attribute
  1487.    FA_HIDDEN   set hidden attribute
  1488.    FA_SYSTEM   set system attribute
  1489.  
  1490.  - file is created in O_BINARY mode
  1491.  - returns nonnegative integer if OK, else -1
  1492.  - uses DOS function INT 21,3C
  1493.  - MSC uses _dos_creat()
  1494.  
  1495. :creat
  1496. ^int creat( const char *filename, int permis )
  1497.  
  1498.  
  1499.  - prototype in io.h, also include stat.h
  1500.  
  1501.  - creates new file (overwrites existing file) of filename
  1502.    with access permission "permis" which is:
  1503.  
  1504.          S_IWRITE
  1505.          S_IREAD
  1506.          S_IWRITE | S_IREAD
  1507.  
  1508.    for permission to write, read or read/write.
  1509.  
  1510.  - file is created set to _fmode (O_TEXT or O_BINARY)
  1511.  
  1512. :creatnew
  1513. %TC:  int creatnew( const char *fname, int attr )
  1514. %MSC: unsigned creatnew( const char *fname, unsigned attr, int fd )
  1515.  
  1516.  
  1517.  - prototype in io.h, also include dos.h
  1518.  
  1519.  - creates new file filename with file attribute attr:
  1520.  - attr consists of a combination of the following:
  1521.  
  1522.    FA_RDONLY   set read only attribute
  1523.    FA_HIDDEN   set hidden attribute
  1524.    FA_SYSTEM   set system attribute
  1525.  
  1526.  - returns nonnegative integer if OK, else -1
  1527.  - file is created set to _fmode (O_TEXT or O_BINARY)
  1528.  - TC: returns nonnegative integer if OK, else -1
  1529.    MSC: return 0 if ok, or DOS error code
  1530.  
  1531. :creattemp
  1532. ^TC: int creattemp( char *filename, int attr )
  1533.  
  1534.  
  1535.  - prototype in io.h, also include dos.h
  1536.  
  1537.  - creates new file (overwrites existing file) of filename with file
  1538.    attribute attrib, for both read/write
  1539.  - attr consists of a combination of the following:
  1540.  
  1541.    FA_RDONLY   set read only attribute
  1542.    FA_HIDDEN   set hidden attribute
  1543.    FA_SYSTEM   set system attribute
  1544.  
  1545.  - filename is a path name ending in a backslash (\); when file is
  1546.    created, filename has a unique path name
  1547.  - file is created set to _fmode (O_TEXT or O_BINARY)
  1548.  - returns nonnegative integer if OK, else -1
  1549.  
  1550. :cscanf
  1551. ^int cscanf( const char *format [,argument,...] )
  1552.  
  1553.  
  1554.  - prototype in conio.h
  1555.  
  1556.  - performs formatted input from console
  1557.  
  1558.  
  1559.  - see SCANF  and  SCANF SPECS
  1560.  
  1561. :ctime
  1562. ^char *ctime( const long *clock )
  1563.  
  1564.  
  1565.  - prototype in time.h
  1566.  
  1567.  - converts date and time to a string
  1568.  - clock is a long integer (such as that returned by time())
  1569.  - generates a 26-character string for date and time
  1570.  - returns pointer to string
  1571.  
  1572. :ctrlbrk
  1573. ^TC: void ctrlbrk( int (*fptr )(void) )
  1574.  
  1575.  
  1576.  - prototype in dos.h
  1577.  
  1578.  - sets a new control-break handler function pointed to by fptr
  1579.  - if CNTL-C hit, then function pointed to by fptr is called
  1580.  - use longjmp() to return to a given point in the program
  1581.  
  1582. :dieeetomsbin:dmsbintoieee:fieeetomsbin:fmsbintoieee
  1583. %     MSC: int dieeetomsbin( double *srcdbl, double *dstdbl )
  1584. %     MSC: int dmsbintoieee( double *srcdbl, double *dstdbl )
  1585. %     MSC: int fieeetomsbin( float *srcflt, float *dstflt )
  1586. %     MSC: int fmsbintoieee( float *srcflt, float *dstflt )
  1587.  
  1588.  
  1589.  - prototype in math.h
  1590.  
  1591.  dieeetomsbin() converts IEEE double to Microsoft double
  1592.  dmsbintoieee() converts Microsoft double to IEEE double
  1593.  fieeetomsbin() converts IEEE float to Microsoft float
  1594.  fmsbintoieee() converts Microsoft float to IEEE float
  1595.  
  1596.  - srcdbl and srcflt are pointers to source values
  1597.  - dstdbl and dstflt are pointers to the destination
  1598.  - returns 0 for success; 1 for failure (overflow)
  1599.  
  1600. :difftime
  1601. ^double difftime( time_t time2, time_t time1 )
  1602.  
  1603.  
  1604.  - prototype in time.h
  1605.  
  1606.  - returns (time2-time1) difference in seconds (double)
  1607.  
  1608. :disable:_disable
  1609. %           TC:  void disable( void )
  1610. %           MSC: void _disable( void )
  1611.  
  1612.  
  1613.  - prototype in dos.h
  1614.  
  1615.  - disables all interrupts except NMI via CLI instruction
  1616.  
  1617. :_displaycursor
  1618. ^MSC: short far _displaycursor( short flag )
  1619.  
  1620.  
  1621.  - prototype in graph.h
  1622.  
  1623.  - flag = _GCURSORON  turn cursor on
  1624.           _GCURSOROFF turn cursor off
  1625.  - cursor is normally turned off while in graphics mode; calling
  1626.    this function determines whether cursor is displayed upon
  1627.    exit from graphics mode
  1628.  - returns previous value of cursor state flag
  1629.  
  1630. :div (c):ldiv
  1631. %    MSC: struct _div_t div( int numer, int denom )
  1632. %    MSC: struct _ldiv_t ldiv( long int numer, long int denom )
  1633.  
  1634.  
  1635.  - prototype in stdlib.h
  1636.  
  1637.  - divides numerator by denominator giving quotient and remainder
  1638.  - returns div_t or ldiv_t structure of the form:
  1639.  
  1640.    struct _div_t        struct _ldiv_t
  1641.       {                    {
  1642.       int quot;            long quot;
  1643.       int rem;             long rem;
  1644.       };                   };
  1645.  
  1646.  
  1647. :_dos_allocmem
  1648. ^MSC: unsigned _dos_allocmem( unsigned size, unsigned *seg )
  1649.  
  1650.  
  1651.  - prototype in dos.h
  1652.  
  1653.  - size = number of paragraphs to allocate
  1654.  - seg = pointer to buffer to contain allocated segment value
  1655.  - returns 0 on success or DOS error code on failure
  1656.  - Turbo C uses allocmem()
  1657.  - see  INT 21,48
  1658.  
  1659. :_dos_close
  1660. ^MSC: unsigned _dos_close( int handle )
  1661.  
  1662.  
  1663.  - prototype in dos.h
  1664.  
  1665.  - handle is standard DOS file handle attained through _dos_creat(),
  1666.    _dos_creat(), _dos_creatnew(), _dos_open(), dup(), open()
  1667.  - returns 0 on success or DOS error code on failure
  1668.  - does not write a CTL-Z to a text file on closing
  1669.  - see  INT 21,3E
  1670.  
  1671. :_dos_creat:_dos_creatnew
  1672. %MSC: unsigned _dos_creatnew(char *fname,unsigned attr,int *handle)
  1673. %MSC: unsigned _dos_creat(char *fname,unsigned attr,int *handle)
  1674.  
  1675.  
  1676.  - prototype in dos.h
  1677.  
  1678.  - fname = a valid DOS file name
  1679.  - attr = DOS file attribute
  1680.         = _A_RDONLY
  1681.         = _A_HIDDEN
  1682.         = _A_SYSTEM
  1683.         = _A_ARCH
  1684.  - handle = pointer to location to receive handle
  1685.  - returns 0 on success or DOS error code on failure
  1686.  - if file sharing is installed, file is opened in compatibility mode
  1687.  - see  INT 21,3C   INT 21,5B
  1688.  
  1689. :_dos_freemem
  1690. ^MSC: unsigned _dos_freemem( unsigned seg )
  1691.  
  1692.  
  1693.  - prototype in dos.h
  1694.  
  1695.  - frees memory allocated via _dos_allocmem() or INT 21,49
  1696.  - returns 0 on success or DOS error code
  1697.  - Turbo C uses freemem()
  1698.  - see  INT 21,49
  1699.  
  1700. :_dos_getdate
  1701. ^MSC: void _dos_getdate( struct dosdate_t *date )
  1702.  
  1703.  
  1704.  - prototype in dos.h
  1705.  
  1706.  - date = pointer to structure to contain returned data of format:
  1707.  
  1708.  struct dosdate_t
  1709.    {
  1710.    unsigned char day;           /* 1-31 */
  1711.    unsigned char month;         /* 1-12 */
  1712.    unsigned int  year;          /* 1980-2099 */
  1713.    unsigned char dayofweek;     /* 0-6 = Sun..Sat */
  1714.    };
  1715.  
  1716.  - Turbo C uses getdate()
  1717.  - see  INT 21,2A
  1718.  
  1719. :_dos_getdiskfree
  1720. %MSC: unsigned _dos_getdiskfree(unsigned drv,struct diskfree_t *spc)
  1721.  
  1722.  
  1723.  - prototype in dos.h
  1724.  
  1725.  - drive =  1 = A:, 2 = B:, 3 = C:, ...
  1726.  - spc = structure to contains disk status information
  1727.  - returns 0 on success or DOS error code on failure
  1728.  
  1729.  struct diskfree_t
  1730.     {
  1731.     unsigned total_clusters;      /* count of all disk clusters */
  1732.     unsigned avail_clusters;      /* free unallocated clusters */
  1733.     unsigned sectors_per_cluster;
  1734.     unsigned bytes_per_sector;
  1735.     };
  1736.  
  1737.  - Turbo C uses getdfree()
  1738.  - see  INT 21,36
  1739.  
  1740. :_dos_getdrive
  1741. ^MSC: void _dos_getdrive( unsigned *drive )
  1742.  
  1743.  
  1744.  - prototype in dos.h
  1745.  
  1746.  - drive = pointer to buffer to receive drive number;
  1747.            0 = A:, 1 = B:, ...
  1748.  - Turbo C uses getdisk()
  1749.  - see  INT 21,19
  1750.  
  1751. :_dos_getfileattr
  1752. ^MSC: unsigned _dos_getfileattr( char *path, unsigned *attr )
  1753.  
  1754.  
  1755.  - prototype in dos.h
  1756.  
  1757.  - path = any valid DOS file name
  1758.  - attr = file attribute:
  1759.  
  1760.         _A_NORMAL
  1761.         _A_RDONLY
  1762.         _A_HIDDEN
  1763.         _A_SYSTEM
  1764.         _A_VOLID
  1765.         _A_SUBDIR
  1766.         _A_ARCH
  1767.  
  1768.  - returns zero on success; nonzero on failure
  1769.  - no corresponding function in Turbo C
  1770.  - see  INT 21,43
  1771.  
  1772. :_dos_getftime
  1773. ^MSC: unsigned _dos_getftime(int h,unsigned *date,unsigned *time)
  1774.  
  1775.  
  1776.  - prototype in dos.h
  1777.  
  1778.  - h = open file handle
  1779.  - date = pointer to memory to receive file date
  1780.  - time = pointer to memory to receive file time
  1781.  - returns 0 on success or DOS error code
  1782.  
  1783.  - Turbo C uses getftime()
  1784.  - see  INT 21,57  _dos_setftime
  1785. :_dos_gettime
  1786. ^MSC: void _dos_gettime( struct dostime_t *time )
  1787.  
  1788.  
  1789.  - prototype in dos.h
  1790.  
  1791.  - returns DOS time into "time"
  1792.  
  1793.  struct dostime_t
  1794.     {
  1795.     unsigned char hour;      /* 0-23 */
  1796.     unsigned char minute;    /* 0-59 */
  1797.     unsigned char second;    /* 0-59 */
  1798.     unsigned char hsecond;   /* hundreths of a second 0-99 */
  1799.     };
  1800.  
  1801.  - Turbo C uses gettime()
  1802.  - see  _dos_setttime
  1803. :_dos_getvect
  1804. ^MSC: void (interrupt far *_dos_getvect( unsigned intnum ))()
  1805.  
  1806.  
  1807.  - prototype in dos.h
  1808.  
  1809.  - intnum = interrupt to get address of (0..255)
  1810.  - returns far pointer to interrupt handler routine
  1811.  
  1812.  - Turbo C uses getvect()
  1813.  - see   INT 21,35   _dos_setvect
  1814. :_dos_keep
  1815. ^MSC: void _dos_keep( unsigned rc, unsigned size )
  1816.  
  1817.  
  1818.  - prototype in dos.h
  1819.  
  1820.  - rc = return code to pass to parent process
  1821.  - size = number of paragraphs to remain resident
  1822.  
  1823.  - Turbo C uses keep()
  1824.  - see  INT 21,31
  1825. :_dos_open
  1826. ^MSC: unsigned _dos_open( char *fname, unsigned mode, int *handle )
  1827.  
  1828.  - prototype in dos.h, fcntl.h (also include share.h)
  1829.  
  1830.  - fname = valid DOS file name
  1831.  - mode = file access permission (a logical or of the following)
  1832.         = O_NOINHERIT file can't be inherited by child process
  1833.         = O_RDONLY    file is read only
  1834.         = O_RDWR      file is read/write
  1835.         = O_WRONLY    file is write only
  1836.         = SH_COMPAT   file sharing compatibility mode
  1837.         = SH_DENYNONE file sharing deny neither read nor write
  1838.         = SH_DENYRD   file sharing deny read
  1839.         = SH_DENYRW   file sharing deny read/write
  1840.         = SH_DENYWR   file sharing deny write
  1841.  
  1842.  - handle = pointer to memory to contain handle
  1843.  - does not creat files, they must currently exist (see _dos_creat)
  1844.  - returns 0 on success or DOS error code
  1845.  
  1846.  - Turbo C uses _open()
  1847.  - see   INT 21,3D   _dos_close   _dos_read  _dos_write  _dos_creat
  1848.  
  1849. :_dos_read
  1850. %    MSC: unsigned _dos_read( int handle, void far *buffer,
  1851. %                             unsigned count, unsigned *nread )
  1852.  
  1853.  
  1854.  - prototype in dos.h
  1855.  
  1856.  - handle = opened file handle
  1857.  - buffer = receives data read from file
  1858.  - count = number of bytes to read
  1859.  - nread = receives the number of bytes actually read
  1860.  - returns 0 on success or DOS error code
  1861.  
  1862.  - Turbo C uses _open()
  1863.  - see   INT 21,3F   _dos_open   _dos_write   _dos_close
  1864.  
  1865. :_dos_setblock
  1866. %  MSC: unsigned _dos_setblock( unsigned size, unsigned seg,
  1867. %                               unsigned *maxsize )
  1868.  
  1869.  
  1870.  - prototype in dos.h
  1871.  
  1872.  - size = new block size
  1873.  - seg = segment of DOS memory block to change
  1874.  - maxsize = size of buffer actually allocated if size not available
  1875.  
  1876.  - returns 0 on success or DOS error code on failure
  1877.  
  1878.  - Turbo C uses setblock()
  1879.  - see   INT 21,4A   _dos_allocmem   _dos_freemem
  1880.  
  1881. :_dos_setdate
  1882. ^MSC: unsigned _dos_setdate( struct dosdate_t *date )
  1883.  
  1884.  
  1885.  - prototype in dos.h
  1886.  
  1887.  - date = receives date information
  1888.  - returns 0 on success or DOS error code on failure
  1889.  - sets DOS date via INT 21,2B
  1890.  - DOS 3.3+ also sets CMOS clock
  1891.  
  1892.  - MS C uses _dos_setdate
  1893.  - see INT 21,2B   _dos_getdate
  1894. :_dos_setdrive
  1895. ^MSC: void _dos_setdrive( unsigned drive, unsigned *count )
  1896.  
  1897.  
  1898.  - prototype in dos.h
  1899.  
  1900.  - drive = drive to set as default;  1 = A:, 2 = B:, ...
  1901.  - count = receives simple count of total drives in system
  1902.  - does not return error if invalid drive is requested, use
  1903.    _dos_getdrive() to see if requested drive was set
  1904.  
  1905.  - Turbo C uses setdisk()
  1906.  - see  INT 21,E   _dos_getdrive
  1907. :_dos_setfileattr
  1908. ^MSC: unsigned _dos_setfileattr( char *path, unsigned attr )
  1909.  
  1910.  
  1911.  - prototype in dos.h
  1912.  
  1913.  - path = valid DOS file name
  1914.  - attr = file attribute (logical OR of the following):
  1915.         = _A_ARCH
  1916.         = _A_HIDDEN
  1917.         = _A_NORMAL
  1918.         = _A_RDONLY
  1919.         = _A_SUBDIR
  1920.         = _A_SYSTEM
  1921.         = _A_VOLID
  1922.  
  1923.  - returns 0 on success or DOS error code on failure
  1924.  
  1925.  - see   INT 21,43   _dos_getfileattr
  1926.  
  1927. :_dos_setftime
  1928. ^MSC: unsigned _dos_setftime(int handle,unsigned date,unsigned time)
  1929.  
  1930.  
  1931.  - prototype in dos.h
  1932.  
  1933.  - handle = opened file handle
  1934.  - date = date to set last file write  (see FILE ATTRIBUTES)
  1935.  - time = time to set last file write  (see FILE ATTRIBUTES)
  1936.  - returns 0 on success or DOS error code on failure
  1937.  
  1938.  - Turbo C uses setftime()
  1939.  - see   INT 21,57   _dos_getftime   FILE ATTRIBUTES
  1940. :_dos_settime
  1941. ^MSC: unsigned _dos_settime( struct dostime_t *time )
  1942.  
  1943.  
  1944.  - prototype in dos.h
  1945.  
  1946.  - time = structure containing new time values
  1947.  - returns 0 on success or DOS error code on failure
  1948.  - sets MS-DOS time via INT 21,2D
  1949.  - DOS 3.3+ also sets CMOS clock
  1950.  
  1951.  - Turbo C uses settime()
  1952.  - see   INT 21,2D   _dos_gettime
  1953.  
  1954. :_dos_setvect
  1955. %MSC: void  _dos_setvect( unsigned intnum,
  1956. %                         void (interrupt far *handler)() )
  1957.  
  1958.  
  1959.  - prototype in dos.h
  1960.  
  1961.  - intnum = interrupt vector to set  (0..255)
  1962.  - handler = new interrupt routine
  1963.  
  1964.  - Turbo C uses setvect()
  1965.  - see  INT 21,25   _dos_getvect()
  1966.  
  1967. :_dos_write
  1968. %   MSC: unsigned _dos_write( int handle, void far *buffer,
  1969. %                             unsigned count, unsigned *nbytes )
  1970.  
  1971.  
  1972.  - prototype in dos.h
  1973.  
  1974.  - handle = opened file handle
  1975.  - buffer = buffer of data to write to file
  1976.  - count = number of bytes to write
  1977.  - nbytes = receives the number of bytes actually written
  1978.  - returns 0 on success or DOS error code on failure
  1979.  
  1980.  - Turbo C uses _write()
  1981.  - see   INT 21,40   _dos_open   _dos_close   _dos_read
  1982.  
  1983. :dosexterr
  1984. %     TC:  int dosexterr( struct DOSERR *errinfo )
  1985. %     MSC: int dosexterr( struct DOSERROR *errinfo )
  1986.  
  1987.  
  1988.  - prototype in dos.h
  1989.  
  1990.  - returns extended error information (unique to MSDOS 3.0+)
  1991.  - errinfo is pointer to DOSERR/DOSERROR structure (defined in dos.h)
  1992.  - if 0 returned, previous DOS call did not result in error
  1993.  - see also PERROR
  1994.  
  1995. :dostounix
  1996. ^TC: long dostounix( struct date *dateptr, struct time *timeptr )
  1997.  
  1998.  
  1999.  - prototype in dos.h
  2000.  
  2001.  - converts date (as from getdate) and time (as from gettime)
  2002.    into UNIX format
  2003.  
  2004. :dup
  2005. ^int dup( int handle )
  2006.  
  2007.  
  2008.  - prototype in io.h
  2009.  
  2010.  - returns a new file handle that duplicates the old handle
  2011.  - returns -1 on error
  2012.  
  2013. :dup2
  2014. ^int dup2( int oldhandle, int newhandle )
  2015.  
  2016.  
  2017.  - prototype in io.h
  2018.  
  2019.  - returns a new file handle that duplicates the old handle
  2020.    equal to newhandle.  If newhandle exists, the corresponding
  2021.    file is closed.
  2022.  - returns -1 on error
  2023.  
  2024. :ecvt
  2025. ^char *ecvt( double value, int ndigit, int *decpt, int *sign )
  2026.  
  2027.  
  2028.  - prototype in stdlib.h
  2029.  
  2030.  - converts a floating pt number to a string of ndigit digits,
  2031.    returning pointer to that string
  2032.  - decpt is position of decimal point (negative value means
  2033.    to left of returned digits) and sign is 0 if positive,
  2034.    else negative
  2035.  
  2036. :_ellipse:_ellipse_w:_elipse_wxy
  2037. %MSC: short _ellipse(short ctl,short x1,short y1,short x2,short y2)
  2038.  
  2039. %MSC: short _ellipse_w( short ctl, double wx1, double wy1,
  2040. %                       double wx2, double wy2 )
  2041.  
  2042. %MSC: short far _ellipse_wxy(short ctl,struct _wxycoord far *pwxy1,
  2043. %                            struct _wxycoord far *pwxy2 )
  2044.  
  2045.  - prototype in graph.h
  2046.  
  2047.  - ctl = _GFILLINTERIOR  fill ellipse with current fill mask
  2048.        = _GBORDER  don't fill ellipse
  2049.  - returns nonzero value if ellipse is drawn ok, zero otherwise
  2050.  - center of ellipse is center of bounding rectangle specified by
  2051.    supplied coordinates
  2052.  
  2053.  - see   _setfillmask
  2054.  
  2055. :enable:_enable
  2056. %           TC:  void enable( void )
  2057. %           MSC: void _enable( void )
  2058.  
  2059.  
  2060.  - prototype in dos.h
  2061.  
  2062.  - enables all interrupts via STI instruction
  2063.  
  2064. :eof
  2065. ^int eof( int handle )
  2066.  
  2067.  
  2068.  - prototype in io.h
  2069.  
  2070.  - returns 1 if end of file for file associated with handle,
  2071.            0 if not end of file
  2072.           -1 if bad file number
  2073.  
  2074. :exec...:exec
  2075. ^Exec Function Call
  2076.  
  2077.  int execl(pathname,arg0,arg1,arg2,...,argN,NULL )
  2078.  int execle(pathname,arg0,arg1,arg2,...,argN,NULL,envp )
  2079.  int execlp(pathname,arg0,arg1,arg2,...,argN,NULL )
  2080.  int execlpe(pathname,arg0,arg1,arg2,....,argN,NULL,envp )
  2081.      char *pathname,*arg0,*arg1,*arg2,....,*argN,*envp[];
  2082.  
  2083.  int execv(pathname,arg,NULL )
  2084.  int execve(pathname,arg,NULL,envp )
  2085.  int execvp(pathname,arg,NULL )
  2086.  int execvpe(pathname,arg,NULL,envp )
  2087.      char *pathname,*arg[],*envp[];
  2088.  
  2089.  - prototype in process.h
  2090.  
  2091.  - loads and runs child processes
  2092.  - pathname search based on MS-DOS search algorithm
  2093.    o if no extension or period - search for exact file name -
  2094.      if not found, add .exe and search again
  2095.    o if extension given, search only for exact file name
  2096.    o if period given, search for file name with no extension
  2097.  
  2098.  
  2099.  - arg0 can be the same as the pathname
  2100.  - at least one argument must be passed
  2101.  - combined argument list cannot exceed 128 bytes
  2102.  - execl..: arg0, arg1,...,argN passed as SEPARATE arguments
  2103.  - execv..: arg[0], arg[1],...,arg[N] passed as argument ARRAY
  2104.  - execlp, execlpe, execvp, execvpe: search for child in PATH
  2105.  - returns no value if OK,
  2106.    returns -1, with  errno set to:
  2107.  
  2108.        E2BIG  (too many args)
  2109.        EACCES (permission denied)
  2110.        EMFILE (too many open files)
  2111.        ENOENT (path or file not found)
  2112.        ENOEXEC (exec format error)
  2113.        ENOMEM (not enough memory).
  2114.  
  2115.  - if successful, there is no return to the caller; the
  2116.    caller is killed off
  2117.  
  2118. :exit
  2119. ^void exit( int completioncode )
  2120.  
  2121.  
  2122.  - prototype in process.h
  2123.  
  2124.  - terminates program, closes all files, buffered output is written,
  2125.    and any registered exit functions (via atexit()) are called
  2126.  
  2127. :_exit
  2128. ^void _exit( int completioncode )
  2129.  
  2130.  
  2131.  - prototype in process.h
  2132.  
  2133.  - terminates program, BUT doesn't close files or write the buffered
  2134.    output and NO registered exit functions (via atexit()) are called
  2135.  
  2136. :exp
  2137. ^double exp( double x )
  2138.  
  2139.  
  2140.  - prototype in math.h
  2141.  
  2142.  - returns y = e**x or HUGE_VAL on error
  2143.  
  2144. :_expand:_based:_fexpand:_nexpand
  2145. %  MSC: void *_expand( void *block, size_t size )
  2146. %  MSC: void far *_fexpand( void far *block, size_t size )
  2147. %  MSC: void near *_nexpand( void near *block, size_t size )
  2148.  
  2149. %  MSC: void _based(void) *_bexpand( _segment seg,
  2150. %            void _based(void) *block, size_t size )
  2151.  
  2152.  
  2153.  - prototype in malloc.h
  2154.  
  2155.  - block = pointer to previously allocated memory block
  2156.  - size = new size in bytes
  2157.  - seg = based segment value
  2158.  - returns pointer to reallocated memory block on success or NULL
  2159.    if not;  (_bexpand returns -1 on failure)
  2160.  
  2161. :fabs
  2162. ^double fabs( double x )
  2163.  
  2164.  
  2165.  - prototype in math.h
  2166.  
  2167.  - returns absolute value of x
  2168.  
  2169. :farcalloc
  2170. ^TC: void far *farcalloc( unsigned long nunits, unsigned long units )
  2171.  
  2172.  
  2173.  - prototype in alloc.h
  2174.  
  2175.  - allocates memory from the far heap for an array of nunits
  2176.    elements, each units bytes long
  2177.  - returns pointer to allocated block or NULL if not enough memory
  2178.  - can allocate all of memory & chunks bigger than 64K
  2179.  - must use far pointers
  2180.  
  2181. :farcoreleft
  2182. ^TC: unsigned long farcoreleft( void )
  2183.  
  2184.  
  2185.  - prototype in alloc.h
  2186.  
  2187.  - returns unused memory in bytes beyond highest allocated block
  2188.  
  2189. :farfree
  2190. ^TC: void farfree( void far *block )
  2191.  
  2192.  
  2193.  - prototype in alloc.h
  2194.  
  2195.  - frees block of previously allocated far memory (block must be
  2196.    allocated by farcalloc)
  2197.  
  2198. :farrealloc
  2199. ^TC: void far *farrealloc( void far *block, unsigned long newsize )
  2200.  
  2201.  
  2202.  - prototype in alloc.h (malloc.h for MS C)
  2203.  
  2204.  - adjusts size of allocated block to newsize, copying contents
  2205.    to a new location if necessary
  2206.  - returns pointer to reallocated block or NULL on error
  2207.  
  2208. :fcvt
  2209. ^char *fcvt( double value, int ndigit, int *decpt, int *sign )
  2210.  
  2211.  
  2212.  - prototype in stdlib.h
  2213.  
  2214.  - converts a floating pt number to a string of ndigit digits,
  2215.    returning pointer to that string
  2216.  - correct digit is rounded for Fortran-F format output of the
  2217.    number of digits equal to ndigit
  2218.  - decpt is position of decimal point (negative value means to left
  2219.    of returned digits) and sign is 0 if positive, else negative
  2220.  
  2221. :fclose
  2222. ^int fclose( FILE *fd )
  2223.  
  2224.  
  2225.  - prototype in stdio.h
  2226.  
  2227.  - closes a file stream (see fdopen() to convert handle to stream)
  2228.  - generally flushes buffers, too
  2229.  - returns 0 on success or EOF on error
  2230.  
  2231. :fcloseall
  2232. ^int fcloseall( void )
  2233.  
  2234.  
  2235.  - prototype in stdio.h
  2236.  
  2237.  - closes all file streams except stdin & stdout
  2238.  - returns 0 on success or EOF on error
  2239.  
  2240. :fdopen
  2241. ^FILE *fdopen( int handle, char *type )
  2242.  
  2243.  
  2244.  - prototype in dos.h
  2245.  
  2246.  - associates a file STREAM with a file HANDLE
  2247.  - handle is returned by creat(), dup(), dup2() or open()
  2248.  - type must match mode of the handle
  2249.  - see fopen() for type descriptions
  2250.  - returns file stream or NULL on error
  2251.  
  2252. :feof
  2253. ^int feof( FILE *stream )
  2254.  
  2255.  
  2256.  - prototype in stdio.h
  2257.  
  2258.  - detects end of file on a file stream
  2259.  - returns zero if NOT eof, else nonzero
  2260.  
  2261. :ferror
  2262. ^int ferror( FILE *stream )
  2263.  
  2264.  
  2265.  - prototype in stdio.h
  2266.  
  2267.  - tests stream for read/write error, return nonzero if error
  2268.  - error remains set until clearerr() or rewind() is called
  2269.  
  2270. :fflush
  2271. ^int fflush( FILE *fd )
  2272.  
  2273.  
  2274.  - prototype in stdio.h
  2275.  
  2276.  - writes contents of output buffers associated with fd to stream
  2277.    and clears input buffer contents; fd is NOT closed
  2278.  - returns 0 on success or EOF on error
  2279.  
  2280. :fgetc
  2281. ^int fgetc( FILE *fd )
  2282.  
  2283.  
  2284.  - prototype in stdio.h
  2285.  
  2286.  - function (not a macro) which gets character from stream
  2287.  - see getc()
  2288.  - returns char (converted to an int) or EOF
  2289.  
  2290. :fgetchar
  2291. ^int fgetchar( void )
  2292.  
  2293.  
  2294.  - prototype in stdio.h
  2295.  
  2296.  - gets character from stream
  2297.  - same as fgetc(stdin)
  2298.  - see getc()
  2299.  - returns char (converted to an int) or EOF
  2300.  
  2301. :fgets
  2302. ^char *fgets( char *s, int size, FILE *fd )
  2303.  
  2304.  
  2305.  - prototype in stdio.h
  2306.  
  2307.  - gets a string from a stream, reading until size - 1 characters
  2308.    have been read or a newline is detected
  2309.  - newline character is retained
  2310.  - returns s argument if OK, else NULL on eof or error
  2311.  
  2312. :filelength
  2313. ^long filelength( int handle )
  2314.  
  2315.  
  2316.  - prototype in io.h
  2317.  
  2318.  - gets file size in bytes for file associated with handle
  2319.  - value returned includes ^Z in ASCII files;  value is the same as
  2320.    displayed in the DOS DIR command
  2321.  - returns -1L on error
  2322.  
  2323. :fileno
  2324. ^int fileno( FILE *stream )
  2325.  
  2326.  
  2327.  - prototype in stdio.h
  2328.  
  2329.  - gets file handle for the given stream
  2330.  - error return undefined
  2331.  
  2332. :findfirst:_dos_findfirst
  2333. %TC: int findfirst( const char *path, struct ffblk *ffblk, int attr)
  2334.  
  2335. %MSC unsigned _dos_findfirst( char *path, unsigned attr,
  2336. %                             struct find_t *fileinfo )
  2337.  
  2338.  - prototype in dir.h, also include dos.h (MS C: dos.h only)
  2339.  
  2340.  - gets disk directory via DOS 0x4E, where attr is:
  2341.  
  2342. %     Turbo C        Microsoft C
  2343.  
  2344.       FA_RDONLY       _A_RDONLY
  2345.       FA_HIDDEN       _A_HIDDEN
  2346.       FA_SYSTEM       _A_SYSTEM
  2347.       FA_LABEL        _A_VOLID
  2348.       FA_DIREC        _A_SUBDIR
  2349.       FA_ARCH         _A_ARCH
  2350.  
  2351. % struct ffblk   /* Turbo C */     struct find_t   /* MSC */
  2352.      {                                {
  2353.      char     ff_reserved[21];        char     reserved[21];
  2354.      char     ff_attrib;              char     attrib;
  2355.      unsigned ff_ftime;               unsigned wr_time;
  2356.      unsigned ff_fdate;               unsigned wr_date;
  2357.      long     ff_fsize;               long     size;
  2358.      char     ff_name[13];            char     name[13];
  2359.      };                               };
  2360.  
  2361.  - attributes can be logically OR'ed
  2362.  - struct ffblk is defined in Turbo C's dir.h
  2363.  - struct find_t is defined in MS C's dos.h
  2364.  - updates DTA, provisions for saving/setting DTA should be made
  2365.  - normal files are always included along with files that match
  2366.    the requested attributes except when the LABEL attribute is
  2367.    requested.  It's up to the programmer to determine which
  2368.    actually match the requested attributes.
  2369.  - returns 0 if OK, -1 if no matching files found or on error
  2370.  
  2371.  - see  FILE ATTRIBUTES,  FINDNEXT,  GETDTA  and  SETDTA
  2372.  
  2373. :findnext:_dos_findnext
  2374. %  TC:  int findnext( struct ffblk *ffblk )
  2375. %  MSC: unsigned _dos_findnext( struct find_t *fileinfo )
  2376.  
  2377.  - prototype in dir.h, also include  (MSC: dos.h only)
  2378.  
  2379.  - findnext updates DTA
  2380.  - returns 0 if OK, -1 if no matching files found or on error
  2381.  - gets next disk directory via DOS 0x4F, after calling findfirst()
  2382.  - struct ffblk is defined in dir.h for Turbo C and dos.h for MSC
  2383.  
  2384. % struct ffblk   /* Turbo C */     struct find_t   /* MSC */
  2385.      {                                {
  2386.      char     ff_reserved[21];        char     reserved[21];
  2387.      char     ff_attrib;              char     attrib;
  2388.      unsigned ff_ftime;               unsigned wr_time;
  2389.      unsigned ff_fdate;               unsigned wr_date;
  2390.      long     ff_fsize;               long     size;
  2391.      char     ff_name[13];            char     name[13];
  2392.      };                               };
  2393.  
  2394.  - normal files are always included along with files that match
  2395.    the requested attributes except when the LABEL attribute is
  2396.    requested.  It's up to the programmer to determine which
  2397.    actually match the requested attributes.
  2398.  - see  FILE ATTRIBUTES,  FINDFIRST,  GETDTA  and  SETDTA
  2399.  
  2400. :_floodfill:_floodfill_w
  2401. %  MSC: short far _floodfill_w( double wx, double wy, short bcolor )
  2402. %  MSC: short far _floodfill( short x, short y, short bcolor )
  2403.  
  2404.  
  2405.  - prototype in graph.h
  2406.  
  2407.  - x, y = coordinates
  2408.  - bcolor = fill boundary color
  2409.  - if (x,y) falls inside a figure, the figure is filled with the
  2410.    with the current fill color;  if it falls outside the figure the
  2411.    background is filled
  2412.  
  2413.  - returns nonzero value on success or 0 on failure
  2414.  
  2415. :floor
  2416. ^double floor( double x )
  2417.  
  2418.  
  2419.  - prototype in math.h
  2420.  
  2421.  - returns largest integer <= x
  2422.  
  2423. :flushall
  2424. ^int flushall( void )
  2425.  
  2426.  
  2427.  - prototype in stdio.h
  2428.  
  2429.  - same as fflush() except ALL open file streams are done
  2430.  - returns integer indicating number of open file streams
  2431.  
  2432. :fmod
  2433. ^double fmod( double x, double y )
  2434.  
  2435.  
  2436.  - prototype in math.h
  2437.  
  2438.  - calculates x modulo y, the remainder of x/y,
  2439.    returning the remainder
  2440.  
  2441. :fnmerge
  2442. %  TC: void fnmerge( char *path, const char *drive,
  2443. %           const char *dir, const char *name, const char *ext)
  2444.  
  2445.  
  2446.  - prototype in dir.h
  2447.  
  2448.  - makes a file name (path) from drive, dir, name, and ext
  2449.  - dir can include subdirectories
  2450.  - maximum sizes for these strings are:
  2451.    MAXPATH  80   path
  2452.    MAXDRIVE  3   drive - includes colon (:)
  2453.    MAXDIR   66   dir - includes leading/trailing backslashes
  2454.    MAXFILE   9   name
  2455.    MAXEXT    5   ext, including leading dot (.)
  2456.  - invertible with fnsplit()
  2457.  
  2458. :fnsplit
  2459. %  TC: void fnsplit( const char *path, char *drive, char *dir,
  2460. %                    char *name, char *ext)
  2461.  
  2462.  
  2463.  - prototype in dir.h
  2464.  
  2465.  - splits a file name from path into drive, dir, name, and ext
  2466.  - dir can include subdirectories
  2467.  - maximum sizes for these strings are:
  2468.    MAXPATH  80   path
  2469.    MAXDRIVE  3   drive - includes colon (:)
  2470.    MAXDIR   66   dir - includes leading/traing backslashes
  2471.    MAXFILE   9   name
  2472.    MAXEXT    5   ext, including leading dot (.)
  2473.  - invertible with fnmerge()
  2474.  
  2475. :fopen
  2476. ^FILE *fopen( const char *filename, const char *type )
  2477.  
  2478.  
  2479.  - prototype in stdio.h
  2480.  
  2481.  - type is a combination of the following:
  2482.   
  2483. %  Mode     Description
  2484.    "r"    read text/binary
  2485.    "w"    write text/binary
  2486.    "a"    append text/binary
  2487.    "+"    allow update access
  2488.    "t"    text file
  2489.    "b"    binary file
  2490.  
  2491. %  Read   Write    Append
  2492.    "rt"    "wt"    "at"    (text)
  2493.    "rb"    "wb"    "ab"    (binary)
  2494.    "r+"    "w+"    "a+"    (update)
  2495.    "r+t"   "w+t"   "a+t"   (update text)
  2496.    "r+b"   "w+b"   "a+b    (update binary)
  2497.  
  2498.    read   - read only (unless "r+")
  2499.    write  - create
  2500.    append - seek to end of file or create file
  2501.  
  2502.  - text mode input, will have CRs discarded
  2503.  - using any of the stdio functions results in a default allocation
  2504.    of 512 bytes for the I/O buffer and the inclusion of the standard
  2505.    memory allocation functions
  2506.  - returns stream or NULL on error
  2507.  
  2508.  
  2509. :fp_off
  2510. ^unsigned FP_OFF( void far *fptr )
  2511.  
  2512.  
  2513.  - prototype in dos.h
  2514.  
  2515.  - gets offset of far pointer fptr
  2516.  - returns unsigned integer value
  2517.  - see also FP_SEG()
  2518.  
  2519.  
  2520.  - not available in some versions of MS C; use the following:
  2521.  
  2522.    #define FP_OFF(fptr)  ((unsigned)(fptr))
  2523.  
  2524. :fp_seg
  2525. ^unsigned FP_SEG( void far *fptr )
  2526.  
  2527.  
  2528.  - prototype in dos.h
  2529.  
  2530.  - gets segment of far pointer fptr
  2531.  - returns unsigned integer value
  2532.  - see also FP_OFF()
  2533.  
  2534.  
  2535.  - not available in some versions of MS C; use the following:
  2536.  
  2537.    #define FP_SEG(fptr) ((unsigned)((unsigned long)(fptr) >> 16))
  2538.  
  2539. :_fpreset
  2540. ^void _fpreset( void )
  2541.  
  2542.  
  2543.  - prototype in float.h
  2544.  
  2545.  - resets floating point math package, usually used with signal(),
  2546.    system(), exec..(), spawn..()
  2547.  - should be called before using 8087/80287 after using one of the
  2548.    above functions
  2549.  - define identically for Turbo C and MS C
  2550.  
  2551. :fprintf
  2552. ^int fprintf( FILE *fd, const char *format [, arg1, arg2, ...] )
  2553.  
  2554.  
  2555.  - prototype in stdio.h
  2556.  
  2557.  - returns number of bytes it attempted to write regardless of
  2558.    success.  To check for a successful fprintf call on a buffered
  2559.    stream, use fflush which returns accurate error information.
  2560.  - using printf or any of the stdio functions results in a default
  2561.    allocation of 512 bytes for the I/O buffer and the inclusion of
  2562.    the standard memory allocation functions
  2563.  - see PRINTF and PRINTF SPEC
  2564.  
  2565. :fputc
  2566. ^int fputc( int c, FILE *fd )
  2567.  
  2568.  
  2569.  - prototype in stdio.h
  2570.  
  2571.  - puts char c to stream fd
  2572.  - using fputc or any of the stdio functions results in a default
  2573.    allocation of 512 bytes for the I/O buffer and the inclusion of
  2574.    the standard memory allocation functions
  2575.  - returns c  or EOF
  2576.  
  2577. :fputs
  2578. ^int fputs( const char *s, FILE *fd )
  2579.  
  2580.  
  2581.  - prototype in stdio.h
  2582.  
  2583.  - using fputs or any of the stdio functions results in a default
  2584.    allocation of 512 bytes for the I/O buffer and the inclusion of
  2585.    the standard memory allocation functions
  2586.  - see puts
  2587.  
  2588. :fread
  2589. ^size_t fread( void *buf, size_t size, size_t count, FILE *fd )
  2590.  
  2591.  
  2592.  - prototype in stdio.h
  2593.  
  2594.  - reads count of data items, each item being size bytes long, from
  2595.    file stream fd
  2596.  - returns number of data items (not bytes) actually read
  2597.  - using fread or any of the stdio functions results in a default
  2598.    allocation of 512 bytes for the I/O buffer and the inclusion of
  2599.    the standard memory allocation functions
  2600.  - returns 0 (or short count) on eof or error
  2601.  
  2602. :free
  2603. ^void free( void *pseg )
  2604.  
  2605.  
  2606.  - prototype in stdlib.h, alloc.h (malloc.h for MS C)
  2607.  
  2608.  - frees allocated block located at pseg
  2609.  - MS C ignores a NULL parameter (see _ffree)
  2610.  
  2611. :_freect
  2612. ^MSC: unsigned _freect( size_t size )
  2613.  
  2614.  
  2615.  - prototype in malloc.h
  2616.  
  2617.  - size = size of allocation in bytes
  2618.  - returns the count of calls to an allocation function a program
  2619.    can make before failing
  2620.  - test is made in default data segment only
  2621.  
  2622. :freemem
  2623. ^TC: int freemem( unsigned seg )
  2624.  
  2625.  
  2626.  - prototype in dos.h
  2627.  
  2628.  - frees previously allocated DOS block defined by seg
  2629.  - returns 0 on success, -1 on error errno=ENONMEM
  2630.  - MS C uses _dos_freemem()
  2631.  - see  INT 21,49
  2632.  
  2633. :freopen
  2634. ^FILE *freopen( const char *fname, const char *type, FILE *fd )
  2635.  
  2636.  
  2637.  - prototype in stdio.h
  2638.  
  2639.  - substitutes named file in place of open fd and closes original fd
  2640.  - useful for changing file attached to stdin, stdout, or stderr
  2641.  - returns fd on success or NULL on error
  2642.  - see fopen() for type descriptions
  2643.  
  2644. :frexp
  2645. ^double frexp( double value, int eptr )
  2646.  
  2647.  
  2648.  - prototype in math.h
  2649.  
  2650.  - calculates mantissa x (a double < 1) and n ( integer) such
  2651.    that value = x * 2**n, storing n in word that eptr points
  2652.  
  2653. :fscanf
  2654. ^int fscanf( FILE *fd, const char *format, arg1, arg2, ... )
  2655.  
  2656.  
  2657.  - prototype in stdio.h
  2658.  
  2659.  - gets formatted input from a stream fd
  2660.  
  2661.  
  2662.  - see SCANF  and  SCANF SPECS
  2663.  
  2664. :fseek
  2665. ^int fseek( FILE *fd, long offset, int mode )
  2666.  
  2667.  
  2668.  - prototype in stdio.h
  2669.  
  2670.  - sets file pointer associated with fd to position which is offset
  2671.    bytes beyond file location given by mode
  2672.  
  2673.  - mode is 0 (beginning of file or SEEK_SET)
  2674.            1 (current position or SEEK_CUR)
  2675.            2 (end of file or SEEK_END
  2676.  
  2677.  - discards any character pushed back by ungetc()
  2678.  - fseek() clears eof indicator but not file error indicator
  2679.  - returns 0 if pointer moved OK, nonzero if file not opened or
  2680.    invalid seek for device.  DOS does not report an error if an
  2681.    attempt to seek past EOF is made
  2682.  
  2683.  - see   ftell
  2684. :fstat
  2685. ^int fstat( int handle, struct stat *buff )
  2686.  
  2687.  
  2688.  - prototype in stat.h
  2689.  
  2690.  - see stat()
  2691.  
  2692. :ftell
  2693. ^long ftell( FILE *fd )
  2694.  
  2695.  
  2696.  - prototype in stdio.h
  2697.  
  2698.  - returns current file position in bytes from beginning of file
  2699.    or -1L on error
  2700.  
  2701.  - see   fseek
  2702. :fwrite
  2703. %size_t fwrite(const void *buf, size_t size, size_t count, FILE *fd)
  2704.  
  2705.  
  2706.  - prototype in stdio.h
  2707.  
  2708.  - writes count of data items, each item being size bytes long, to
  2709.    file stream fd
  2710.  - returns number of data items (not bytes) actually written
  2711.  - returns short count on error
  2712.  
  2713. :gcvt
  2714. ^char *gcvt( double value, int ndigit, char *buf )
  2715.  
  2716.  
  2717.  - prototype in stdlib.h
  2718.  
  2719.  - converts a floating point number to a string of ndigit digits,
  2720.    storing string into buf and returning pointer to that string
  2721.  - output in Fortran-F format if possible, else in Fortran-E format
  2722.  
  2723. :geninterrupt
  2724. ^TC: void geninterrupt( int interrupt_num )
  2725.  
  2726.  
  2727.  - prototype in dos.h
  2728.  
  2729.  - generates actual interrupt for "interrupt_num" in code
  2730.  - not a true function, but inline code generation
  2731.  
  2732. :getc
  2733. ^int getc( FILE *fd )
  2734.  
  2735.  
  2736.  - prototype in stdio.h
  2737.  
  2738.  - macro which returns next character in file stream fd or EOF
  2739.    on end of file or error
  2740.  
  2741. :getcbrk
  2742. ^TC: int getcbrk( void )
  2743.  
  2744.  
  2745.  - prototype in dos.h
  2746.  
  2747.  - gets control-break setting
  2748.  
  2749.  - return 0  cntl-C is off
  2750.           1  cntl-C is on
  2751.  
  2752. :getch
  2753. ^int getch( void )
  2754.  
  2755.  
  2756.  - prototype in conio.h
  2757.  
  2758.  - returns next character from console without echoing
  2759.  
  2760. :getchar
  2761. ^int getchar( void )
  2762.  
  2763.  
  2764.  - prototype in stdio.h
  2765.  
  2766.  - returns next character in file stream stdin or EOF on end of
  2767.    file or error
  2768.  - implemented as a macro
  2769.  
  2770. :getche
  2771. ^int getche( void )
  2772.  
  2773.  
  2774.  - prototype in conio.h
  2775.  
  2776.  - function which returns next character from console WITH echoing
  2777.  
  2778. :_getcolor
  2779. ^MSC: short far _getcolor( void )
  2780.  
  2781.  - prototype in graph.h
  2782.  
  2783.  - returns the current color number
  2784.  - default color is the highest valid color in current palette
  2785.  
  2786.  
  2787. :getcolor:putcolor
  2788. %MSC: flagType GetColor( LINE line, la *colorlist, PFILE pFile )
  2789. %MSC: void PutColor( LINE line, la *colorlist, PFILE pFile )
  2790.  
  2791.  
  2792.  - prototype in ext.h
  2793.  
  2794.  - GetColor returns nonzero if a color is attached to the line;
  2795.    zero otherwise
  2796.  
  2797. :getcurdir
  2798. ^TC: int getcurdir( int drive, char *direc )
  2799.  
  2800.  
  2801.  - prototype in dir.h
  2802.  
  2803.  - get current directory for specified drive (0=default, 1=A, etc)
  2804.  - direc will contain directory name
  2805.  
  2806.  - returns 0 if OK
  2807.           -1 on error
  2808.  
  2809. :_getcurrentposition
  2810. %     MSC: struct xycoord far _getcurrentposition( void )
  2811. %     MSC: struct _wxycoord far _getcurrentposition_w( void )
  2812.  
  2813.  
  2814.  - prototype in graph.h
  2815.  
  2816.  - returns current position coordinates in struct xycoord format
  2817.  
  2818. :getcwd
  2819. ^char *getcwd( char *buf, int n )
  2820.  
  2821.  
  2822.  - prototype in dir.h
  2823.  
  2824.  - gets full path name of current working directory up to n bytes,
  2825.    placed into buf
  2826.  - returns buf pointer, else NULL
  2827.  
  2828. :getdate
  2829. ^TC: void getdate( struct date *dateblk )
  2830.  
  2831.  - prototype in dos.h
  2832.  
  2833.  - gets DOS date, filling it into the following structures:
  2834.  
  2835.  struct date
  2836.    {
  2837.    int   da_year;   /* Year including century */
  2838.    char  da_day;    /* Day of the month */
  2839.    char  da_mon;    /* Month (1 = Jan) */
  2840.    };
  2841.  
  2842.  - MS C uses _dos_getdate()
  2843.  - see  INT 21,2A
  2844.  
  2845. :getdfree
  2846. ^TC: void getdfree( unsigned char drive, struct dfree *dfreep )
  2847.  
  2848.  
  2849.  - prototype in dos.h
  2850.  
  2851.  - fills in structure with disk status information.
  2852.  
  2853.    struct dfree
  2854.       {
  2855.       unsigned df_avail;   /* available clusters */
  2856.       unsigned df_total;   /* total clusters */
  2857.       unsigned df_bsec;    /* bytes per sector */
  2858.       unsigned df_sclus;   /* sectors per cluster */
  2859.       };
  2860.  
  2861.  - drive is specified as A = 1, B = 2, C = 3, etc...
  2862.  - in event of error, df_sclus is set to -1.
  2863.  - MS C uses _dos_getdiskfree()
  2864.  - see  INT 21,36
  2865.  
  2866. :getdisk
  2867. ^TC: int getdisk( void )
  2868.  
  2869.  
  2870.  - prototype in dir.h
  2871.  
  2872.  - returns integer drive number; 0 = A:, 1 = B:, ...
  2873.  - MS C uses _dos_getdrive()
  2874.  - see  INT 21,19
  2875.  
  2876. :getdta
  2877. ^TC: char far *getdta( void )
  2878.  
  2879.  
  2880.  - prototype in dos.h
  2881.  
  2882.  - returns current setting of the DTA as a far pointer
  2883.  - see  INT 21,2F
  2884.  
  2885. :getenv
  2886. ^char *getenv( const char *envvar )
  2887.  
  2888.  
  2889.  - prototype in stdlib.h
  2890.  
  2891.  - gets string from environment
  2892.  - MSDOS environment consists of strings of form envvar=varvalue,...
  2893.  - returns varvalue or 0 if envvar not found in environment
  2894.  
  2895. :getfat
  2896. ^TC: void getfat( unsigned char drive, struct fatinfo *fatblkp )
  2897.  
  2898.  
  2899.  - prototype in dos.h
  2900.  
  2901.  - returns information from the file allocation table for the
  2902.    specified drive (0=default,1=A, etc) into fatblk
  2903.  - structure fatinfo is defined as:
  2904.  
  2905.  struct fatinfo
  2906.    {
  2907.    char fi_sclus;  /* sectors per cluster */
  2908.    char fi_fatid;  /* media descriptor byte  from FAT */
  2909.    int  fi_nclus;  /* cluster on disk */
  2910.    int  fi_bysec;  /* bytes per sector */
  2911.    };
  2912.  
  2913.  - closest MS C function is _dos_getdiskfree()
  2914.  - see  INT 21,1C
  2915.  
  2916. :getfatd
  2917. ^TC: void getfatd( struct fatinfo *fatblkp )
  2918.  
  2919.  
  2920.  - prototype in dos.h
  2921.  
  2922.  - returns information from the file allocation table for the
  2923.    DEFAULT drive into fatblk
  2924.  - structure fatinfo is defined as:
  2925.  
  2926.  struct fatinfo
  2927.    {
  2928.    char fi_sclus;  /* sectors per cluster */
  2929.    char fi_fatid;  /* media descriptor byte  from FAT */
  2930.    int  fi_nclus;  /* cluster on disk */
  2931.    int  fi_bysec;  /* bytes per sector */
  2932.    };
  2933.  
  2934.  - closest MS C function is _dos_getdiskfree()
  2935.  - see  INT 21,1B   getfat
  2936.  
  2937. :_getfillmask
  2938. ^MSC: unsigned char far *_getfillmask( unsigned char far *mask )
  2939.  
  2940.  
  2941.  - prototype in graph.h
  2942.  
  2943.  - mask = receives current fill mask or NULL if mask not present
  2944.  
  2945. :getftime
  2946. ^TC: int getftime( int handle, struct ftime *ftimep )
  2947.  
  2948.  
  2949.  - prototype in dos.h
  2950.  
  2951.  - retrieves file time and date for the file associated with
  2952.    handle into ftimep
  2953.  - structure ftime is defined in dos.h
  2954.  - MS C uses _dos_getftime()
  2955.  - see  INT 21,57
  2956.  
  2957. :_getimage:_getimage_w:_getimage_wxy
  2958. %MSC: void far _getimage( short x1, short y1, short x2, short y2,
  2959. %                         char huge *image )
  2960.  
  2961. %MSC: void far _getimage_w( double wx1, double wy1, double wx2,
  2962. %                           double wy2, char huge *image )
  2963.  
  2964. %MSC: void far _getimage_wxy( struct _wxycoord far *pwxy1,
  2965. %                       struct _wxycoord far *pwxy2,char huge *image)
  2966.  
  2967.  
  2968.  - prototype in graph.h
  2969.  
  2970.  - (x1, y1) upper left coordinates of rectangle
  2971.  - (x2, y2) lower right coordinates of rectangle
  2972.  - image = buffer to receive screen image
  2973.  
  2974.  - Turbo C uses getimage()
  2975.  
  2976. :getimage
  2977. %  TC: void far getimage( int left, int top, int right,
  2978. %                         int bottom, void far *bitmap )
  2979.  
  2980.  
  2981.  - prototype in graphics.h
  2982.  
  2983.  - copies video data from the screen rectange to buffer "bitmap"
  2984.  - bitmap must be large enough to hold entire buffer plus 4 bytes
  2985.    (2 words) for height and width information.  Function imagesize()
  2986.    should be used to determine the size of the buffer to avoid
  2987.    overwriting adjacent memory.
  2988.  
  2989.  - MS C uses _getimage()
  2990.  - see PUTIMAGE and IMAGESIZE
  2991.  
  2992. :_getlinestyle
  2993. ^MSC: unsigned short far _getlinestyle( void )
  2994.  
  2995.  
  2996.  - prototype in graph.h
  2997.  
  2998.  - returns current line style mask
  2999.  - each 1 bit represents a pixel (in current color) in the line
  3000.    mask;  each 0 represent a pixel that is left alone
  3001.  
  3002.  - see   _setlinestyle
  3003.  
  3004. :_getlogcoord:_getviewcoord
  3005. ^struct xycoord far _getlogcoord( short x, short y )
  3006.  
  3007.  
  3008.  - prototype in graph.h
  3009.  
  3010.  - translates physical coordinates to logical coordinates returning
  3011.    the result in the format:
  3012.  
  3013.  struct xycoord
  3014.     {
  3015.     short xcoord;
  3016.     short ycoord;
  3017.     };
  3018.  
  3019.  - _getviewcoord() obsolete; use _getlogcoord()
  3020.  - see _getphyscoord()
  3021.  
  3022. :getpass
  3023. ^TC: char *getpass( const char *prompt )
  3024.  
  3025.  
  3026.  - prototype in conio.h
  3027.  
  3028.  - reads a password from system console after typing prompt,
  3029.    without echoing
  3030.  - password cannot exceed 8 chars (not counting null terminator)
  3031.  
  3032. :_getphyscoord
  3033. ^MSC: struct xycoord far _getphyscoord( short x, short y )
  3034.  
  3035.  
  3036.  - prototype in graph.h
  3037.  
  3038.  - translates logical coordinates to physical coordinates returning
  3039.    the result in the format:
  3040.  
  3041.  struct xycoord
  3042.     {
  3043.     short xcoord;
  3044.     short ycoord;
  3045.     };
  3046.  
  3047.  - see _getlogcoord()
  3048.  
  3049. :getpid
  3050. ^MSC: int getpid( void )
  3051.  
  3052.  
  3053.  - prototype in process.h
  3054.  
  3055.  - returns process ID identifying the calling process (PSP segment)
  3056.  
  3057.  - Turbo C uses getpsp()
  3058.  
  3059. :_getpixel:_getpixel_w
  3060. %         MSC: short far _getpixel( short x, short y )
  3061. %         MSC: short far _getpixel_w( double wx, double wy )
  3062.  
  3063.  
  3064.  - prototype in graph.h
  3065.  
  3066.  - returns pixel value on success or -1 on failure
  3067.  - Turbo C uses getpixel()
  3068.  
  3069. :getpsp
  3070. ^TC: unsigned getpsp( void )
  3071.  
  3072.  
  3073.  - prototype in dos.h
  3074.  
  3075.  - returns segment address of the PSP using DOS call 0x62
  3076.  - valid only for DOS 3.x
  3077.  - use global variable _psp to get PSP instead for DOS 2.X
  3078.  - MS C uses getpid()
  3079.  
  3080. :gets
  3081. ^char *gets( char *s )
  3082.  
  3083.  
  3084.  - prototype in stdio.h
  3085.  
  3086.  - reads string from stdin until newline character is read
  3087.  - newline character is replaced by \0
  3088.  - returns string or NULL on end-of-file or error
  3089.  
  3090. :_gettextcolor
  3091. ^MSC: short far _gettextcolor( void )
  3092.  
  3093.  
  3094.  - prototype in graph.h
  3095.  
  3096.  - returns current text color value
  3097.  
  3098. :_gettextposition
  3099. ^MSC: struct rccoord far _gettextposition( void )
  3100.  
  3101.  
  3102.  - prototype in graph.h
  3103.  
  3104.  - returns current text position via rccoord structure:
  3105.  
  3106.    struct rccoord
  3107.       {
  3108.       short  row;
  3109.       short col;
  3110.       };
  3111.  
  3112. :gettime
  3113. ^TC: void gettime( struct time *timep )
  3114.  
  3115.  
  3116.  - prototype in dos.h
  3117.  
  3118.  - gets MS-DOS time into the following data structure:
  3119.  
  3120.    struct time
  3121.      {
  3122.      unsigned char  ti_min;
  3123.      unsigned char  ti_hour;
  3124.      unsigned char  ti_hund;
  3125.      unsigned char  ti_sec;
  3126.      };
  3127.  
  3128.  - MS C uses _dos_gettime()
  3129.  
  3130. :getvect
  3131. ^TC: void interrupt (*getvect( int intr_num ))()
  3132.  
  3133.  
  3134.  - prototype in dos.h
  3135.  
  3136.  - returns the value of the interrupt vector named by intr_num
  3137.  - returns 4-byte far pointer to current interrupt service routine
  3138.    stored in interrupt vector table
  3139.  - Example:
  3140.  
  3141.       void interrupt (*old_int_1c)();
  3142.  
  3143.       old_int_1c = getvect( 0x1c );
  3144.  
  3145.  - MS C uses _dos_getvect()
  3146.  - see INT 21,35
  3147.  
  3148. :getverify
  3149. ^TC: int getverify( void )
  3150.  
  3151.  
  3152.  - prototype in dos.h
  3153.  
  3154.  - returns current state of verify flag (0==off, 1==on)
  3155.  - see  INT 21,54
  3156.  
  3157. :_getvideoconfig
  3158. %    MSC: struct videoconfig far *_getvideoconfig(
  3159. %                            struct videoconfig far *config )
  3160.  
  3161.  - prototype in graph.h
  3162.  
  3163.  - returns video configuration information via struct videoconfig:
  3164.  
  3165.    struct videoconfig
  3166.       {
  3167.       short numxpixels;    /* pixels on X axis */
  3168.       short numypixels;    /* pixels on Y axis */
  3169.       short numtextcols;   /* text columns available */
  3170.       short numtextrows;   /* text rows available */
  3171.       short numcolors;     /* actual colors available */
  3172.       short bitsperpixel;  /* bits per pixel */
  3173.       short numvideopages; /* available video page count */
  3174.       short mode;          /* current video mode */
  3175.       short adapter;       /* active display adapter */
  3176.       short monitor;       /* active display monitor */
  3177.       short memory;        /* adapter video memory in K */
  3178.       };
  3179.  
  3180. :getw
  3181. ^int getw( FILE *fd )
  3182.  
  3183.  
  3184.  - prototype in stdio.h
  3185.  
  3186.  - gets integer from file stream fd
  3187.  - returns EOF (-1) on eof or error
  3188.  - use feof() or ferror() to verify -1 is an integer data word, and
  3189.    not an error return
  3190.  
  3191. :gmtime
  3192. ^struct tm *gmtime( const time_t *clock )
  3193.  
  3194.  
  3195.  - prototype in time.h
  3196.  
  3197.  - clock is a long integer (such as that returned by time())
  3198.  - returns GMT time in struct tm (see time.h) correcting for time
  3199.    zone and any daylight savings time
  3200.  - global variable timezone is difference in seconds between GMT
  3201.    and local standard time
  3202.  
  3203. :gsignal
  3204. ^int gsignal( int sig )
  3205.  
  3206.  
  3207.  - prototype in signal.h
  3208.  
  3209.  - ssignal() and gsignal() implement a software-signaling facility
  3210.    where software signals are integers 1-15
  3211.  - gsignal() raises the signal given by sig and executes the action
  3212.    routine
  3213.  - gsignal() returns value by action or SIG_IGN or SIG_DFL
  3214.  - see ssignal()
  3215.  - UNIX based
  3216.  
  3217. :halloc
  3218. ^MSC: void huge *halloc( long num, size_t size )
  3219.  
  3220.  
  3221.  - prototype in malloc.h
  3222.  
  3223.  - num = count of elements to allocate
  3224.  - size = size of each element;  each element is set to zero;
  3225.           must be a power of 2 if size is over 128K
  3226.  - alignment assures compatibility with all data types (para)
  3227.  - returns pointer to allocated block on success or NULL on failure
  3228.  - allocates memory directly from DOS
  3229.  
  3230.  - see  hfree
  3231.  
  3232. :_harderr:_hardresume:_hardretn
  3233. %        MSC: void _hardresume( int result )
  3234. %        MSC: void _hardretn( int error )
  3235. %        MSC: void _harderr( void (far *handler)() )
  3236.  
  3237.  - prototype in dos.h
  3238.  
  3239.  - result = return value from handler
  3240.  - error = number of error
  3241.  
  3242.  - _harderr() registers a user critical error handler with it's
  3243.    own error handler which is to be called during a critical error
  3244.  
  3245.  - handler = new INT 24h handler with the format:
  3246.    handler(unsigned deverr,unsigned errcode,unsigned far *devhdr)
  3247.    where: deverr = device error code (AX value DOS passes to INT 24)
  3248.           errcode = error code (DI value DOS passes to INT 21)
  3249.           devhdr = pointer to device header on which error occurred
  3250.  - handler must return via one of three methods:
  3251.      simple return  returns to DOS error handler
  3252.      _hardresume()  returns to DOS error handler
  3253.      _hardretn()  returns to the application
  3254.  
  3255.  - hardresume() returns one of the following:
  3256.    _HARDERR_ABORT  DOS should abort the process via INT 23
  3257.    _HARDERR_FAIL  DOS should fail the call (DOS 3.x+)
  3258.    _HARDERR_IGNORE  DOS should ignore the error
  3259.    _HARDERR_RETRY  DOS should retry the operation
  3260.  - due to the complexity of these functions consult the vendor
  3261.    documentation for more specific details
  3262.  
  3263.  - Turbo C uses  hardretn(), harderr() and hardresume()
  3264.  - see   INT 24
  3265.  
  3266. :harderr
  3267. ^TC: void harderr( int (*fptr)())
  3268.  
  3269.  - prototype in dos.h
  3270.  
  3271.  - harderr() establishes a hardware error handler for current
  3272.    program, invoked wherever interrupt 0x24 occurs
  3273.  - function fptr is called when such an interrupt occurs
  3274.  - handler function will be called with the following
  3275.    arguments= handler( int errval, int ax, int bp, int si)
  3276.    where errval is error code in DI register by MS-DOS, and
  3277.    ax, bp, si are values MS-DOS has in AX, BP, and SI regs
  3278.  - ax indicates if disk or other device error occurs;  if ax is
  3279.    not negative, then disk error, else device error.  For disk
  3280.    error, ax ANDed with 0x00ff will give bad drive number
  3281.  - bp and si together point to device driver header
  3282.  - hardresume() may be called with rescode to return
  3283.    to MS-DOS, where rescode is
  3284.  
  3285.          2 - for abort
  3286.          1 - retry
  3287.          0 - ignore
  3288.  
  3289.  - hardrtn() may be called to return directly to the application
  3290.  - handler must return:
  3291.  
  3292.            0 - ignore
  3293.            1 - retry
  3294.            2 - abort
  3295.  
  3296.  - handler may issue DOS calls 1 through 0xC, but no others, and
  3297.    no C standard I/O or UNIX I/O calls may be used
  3298.  - MS C uses _harderr()
  3299.  
  3300.  - see   hardresume   hardretn   INT 24
  3301.  
  3302. :hardresume
  3303. ^TC: void hardresume( int rescode )
  3304.  
  3305.  
  3306.  - prototype in dos.h
  3307.  
  3308.  - hardresume() may be called with rescode to return to DOS,
  3309.    where rescode is:
  3310.  
  3311.        2 - abort
  3312.        1 - retry
  3313.        0 - ignore
  3314.  
  3315.  - see harderr()
  3316.  - MS C uses _hardresume()
  3317.  
  3318. :hardretn
  3319. ^TC: void hardretn( int errcode )
  3320.  
  3321.  
  3322.  - prototype in dos.h
  3323.  
  3324.  - hardretn() may be called to return directly to the application
  3325.  - see harderr()
  3326.  - MS C uses _hardretn
  3327.  
  3328. :_heapchk:_bheapchk:_fheapchk:_nheapchk
  3329. %        MSC: int _heapchk( void )
  3330. %        MSC: int _bheapchk( _segment seg )
  3331. %        MSC: int _fheapchk( void )
  3332. %        MSC: int _nheapchk( void )
  3333.  
  3334.  
  3335.  - prototype in malloc.h
  3336.  
  3337.  - runs consistency check on different heaps
  3338.  - heapchk maps to the other functions depending on memory model
  3339.  
  3340.  - returns one of the following:
  3341.  
  3342.    _HEAPOK       heap is ok
  3343.    _HEAPBADBEGIN initials allocation header couldn't be found
  3344.    _HEAPBADNODE  heap/node has been damaged
  3345.    _HEAPEMPTY    heap has not been initialized
  3346.  
  3347.  - see   heapset   heapwalk
  3348.  
  3349. :_heapset:_bheapset:_fheapset:_nheapset
  3350. %        MSC: int _heapset( unsigned fill )
  3351. %        MSC: int _bheapset( _segment seg, unsigned fill )
  3352. %        MSC: int _fheapset( unsigned fill )
  3353. %        MSC: int _nheapset( unsigned fill )
  3354.  
  3355.  
  3356.  - prototype in malloc.h
  3357.  
  3358.  - heapset maps to the other functions depending on memory model
  3359.  - first check heap consistency via heapchk() then fills memory
  3360.    with value specified in "fill"
  3361.  
  3362.  - returns one of the following:
  3363.  
  3364.    _HEAPOK       heap is ok
  3365.    _HEAPBADBEGIN initials allocation header couldn't be found
  3366.    _HEAPBADNODE  heap/node has been damaged
  3367.    _HEAPEMPTY    heap has not been initialized
  3368.  
  3369.  - see   heapchk   heapwalk
  3370. :_heapwalk:_bheapwalk:_fheapwalk:_nheapwalk
  3371. %     MSC: int _heapwalk( struct _heapinfo *entry )
  3372. %     MSC: int _bheapwalk( _segment seg, struct _heapinfo *entry )
  3373. %     MSC: int _fheapwalk( struct _heapinfo *entry )
  3374. %     MSC: int _nheapwalk( struct _heapinfo *entry )
  3375.  
  3376.  - prototype in malloc.h
  3377.  
  3378.  - walks the heap for each entry specified and returns information
  3379.    about the entry via the other fields of the _heapinfo structure
  3380.  - heapwalk maps to the other functions depending on memory model
  3381.  - returns one of the following:
  3382.  
  3383.    _HEAPOK       heap is ok
  3384.    _HEAPBADBEGIN initials allocation header couldn't be found
  3385.    _HEAPBADNODE  heap/node has been damaged
  3386.    _HEAPEMPTY    heap has not been initialized
  3387.    _HEAPBADPTR   parameter does not contain valid pointer to heap
  3388.    _HEAPEND      end of help found w/o problem
  3389.  
  3390.  struct _heapinfo
  3391.     {
  3392.     int    _far *_pentry;   /* heap entry pointer */
  3393.     size_t _size;           /* size of heap entry */
  3394.     int    _useflag;        /* entry in use return value */
  3395.     };
  3396.  
  3397.  - see   heapchk   heapset
  3398.  
  3399. :hfree
  3400. ^MSC: void hfree( void huge *block )
  3401.  
  3402.  
  3403.  - prototype in malloc.h
  3404.  
  3405.  - block = pointer to block of allocated memory
  3406.  - memory is returned to DOS
  3407.  - freeing an unallocated block will corrupt the DOS's MCB chain
  3408.  
  3409.  - see   halloc
  3410.  
  3411. :hypot
  3412.  
  3413.  double hypot( double x, double y )
  3414.  
  3415.  - prototype in math.h
  3416.  
  3417.  - returns z where z**2 = x**2 + y**2, or HUGE_VAL on error
  3418.  
  3419. :imagesize
  3420. ^unsigned far imagesize(int left, int top, int right, int bottom)
  3421.  
  3422.  
  3423.  - prototype in graphics.h
  3424.  
  3425.  - returns the size of the buffer required to hold the screen image
  3426.    represented by the coordinates
  3427.  returns size or 0xFFFF on error (image >= 64K-1)
  3428.  
  3429. :inp:inpw
  3430. %           MSC: int inp( unsigned port )
  3431. %           MSC: unsigned inpw( unsigned port )
  3432.  
  3433.  
  3434.  - prototype in conio.h
  3435.  
  3436.  - port = hardware I/O port 0-3FFh
  3437.  - returns byte or word data read from port
  3438.  
  3439. :inport
  3440. ^TC: int inport( int port )
  3441.  
  3442.  
  3443.  - prototype in dos.h
  3444.  
  3445.  - inport() reads word from input port port
  3446.  - MS C uses inpw()
  3447.  - see inportb()
  3448.  
  3449. :inportb
  3450. ^TC: unsigned char inportb( int port )
  3451.  
  3452.  
  3453.  - prototype in dos.h
  3454.  
  3455.  - inportb() is macro that reads a byte from hardware port 'port'
  3456.  - MS C uses inp()
  3457.  - see inport()
  3458.  
  3459. :int86
  3460. ^int int86( int intr_num, union REGS *inregs, union REGS *outregs )
  3461.  
  3462.  
  3463.  - prototype in dos.h
  3464.  
  3465.  - Executes 8086 software interrupt specified by intr_num
  3466.  - Copies register values from inregs into the registers
  3467.  - if CF is set, an error has occurred
  3468.  - unique to DOS
  3469.  - see int86x() also
  3470.  
  3471. :int86x
  3472. %     int int86x( int intr_num, union REGS *inregs,
  3473. %                 union REGS *outregs, struct SREGS *segregs )
  3474.  
  3475.  
  3476.  - prototype in dos.h
  3477.  
  3478.  - Executes 8086 software interrupt specified by intr_num
  3479.  - Copies register values from inregs into the registers
  3480.  - also copies segregs->x.ds and segregs->y.es into DS/ES
  3481.  - if CF is set, an error has occurred
  3482.  - unique to DOS
  3483.  - see int86() also
  3484.  
  3485. :intdos
  3486. ^int intdos(union REGS *inregs, union REGS *outregs )
  3487.  
  3488.  
  3489.  - prototype in dos.h
  3490.  
  3491.  - Executes 8086 software interrupt 0x21
  3492.  - Copies register values from inregs into the registers
  3493.  - if CF is set, an error has occurred
  3494.  - unique to DOS
  3495.  - see intdosx() also
  3496.  
  3497. :intdosx
  3498. %  int intdosx( union REGS *inregs, union REGS *outregs,
  3499. %               struct SREGS *segregs )
  3500.  
  3501.  
  3502.  - prototype in dos.h
  3503.  
  3504.  - executes 8086 software interrupt 0x21
  3505.  - copies register values from inregs into the registers
  3506.  - copies segregs->x.ds and segregs->y.es into DS/ES
  3507.  - if CF is set, an error has occurred
  3508.  - unique to DOS
  3509.  - see intdos() also
  3510.  
  3511. :intr
  3512. ^TC: void intr( int intr_num, struct REGPACK *preg )
  3513.  
  3514.  
  3515.  - prototype in dos.h
  3516.  
  3517.  - same as int86 except that preg contains registers values
  3518.    both before & after executing interrupt
  3519.  
  3520. :ioctl
  3521. ^TC: int ioctl( int handle, int cmd [, void *argdx, int argcx] )
  3522.  
  3523.  - prototype in io.h
  3524.  
  3525.  - direct interface to  INT 21,44  (IOCTL)
  3526.  - cmd = 0  get device information
  3527.          1  set device information (in argdx)
  3528.          2  read argcx bytes into addr given by argdx
  3529.          3  write argcx bytes from addr given by argdx
  3530.          4  same as 2, but handle treated as drive (0=def.,1=A)
  3531.          5  same as 3, but handle treated as drive (0=def.,1=A)
  3532.          6  get input status
  3533.          7  get output status
  3534.          8  test removability (DOS 3.x)
  3535.          11 set sharing conflict retry count (DOS 3.x)
  3536.  - cmd = 0,1; returns device information (DX of IOCTL call)
  3537.  - cmd = 2-5; returns count of bytes transferred
  3538.  - cmd = 6,7; returns device status
  3539.  - returns -1 on error & errno = EINVAL, EBADF, or EINVDAT
  3540.  - no corresponding function in MS C
  3541.  - see INT 21,44  and  IOCTL,n   where "n" is the function (0-F)
  3542. :is...:is
  3543. ^Character Test Macros
  3544.  
  3545.  int isalnum( int c ) - nonzero if letter or digit
  3546.  int isalpha( int c ) - nonzero if letter
  3547.  int isascii( int c ) - nonzero if in range 0-127
  3548.  int iscntrl( int c ) - nonzero if 0x7F, or 0x00-0x1F
  3549.  int isdigit( int c ) - nonzero if digit
  3550.  int isgraph( int c ) - nonzero if printable 0x21-0x7E excl space
  3551.  int islower( int c ) - nonzero if lowercase
  3552.  int isprint( int c ) - nonzero if printable 0x20-0x7E
  3553.  int ispunct( int c ) - nonzero if punct char (iscntrl | isspace)
  3554.  int isspace( int c ) - nonzero if space,tab, CR, LF, VT or FF
  3555.  int isupper( int c ) - nonzero if uppercase
  3556.  int isxdigit( int c ) - nonzero if hexadecimal digit
  3557.  
  3558.  
  3559.  - prototype in ctype.h
  3560.  
  3561. :isatty
  3562. ^int isatty( int handle )
  3563.  
  3564.  
  3565.  - prototype in io.h
  3566.  
  3567.  - if handle is associated with a character device like tty,
  3568.    console, printer, or serial port returns a non-zero integer
  3569.    otherwise returns zero
  3570.  
  3571. :itoa
  3572. ^char *itoa( int value, char *string, int radix )
  3573.  
  3574.  
  3575.  - prototype in stdlib.h
  3576.  
  3577.  - converts value to string where radix specifies base (2-36)
  3578.  
  3579. :kbhit
  3580. ^int kbhit( void )
  3581.  
  3582.  
  3583.  - prototype in conio.h
  3584.  
  3585.  - returns nonzero if keystroke available else 0
  3586.  
  3587. :keep
  3588. ^TC: void keep( unsigned char status, int size )
  3589.  
  3590.  
  3591.  - prototype in dos.h
  3592.  
  3593.  - keep() returns to MS-DOS with exit status supplied in status,
  3594.    retaining current program resident in memory with size paras and
  3595.    rest of memory freed
  3596.  - MS C uses _dos_keep()
  3597.  - see INT 21,31
  3598.  
  3599.  
  3600. :labs
  3601. ^long labs( long n )
  3602.  
  3603.  
  3604.  - prototype in stdlib.h
  3605.  
  3606.  - returns absolute long value of n
  3607.  
  3608. :ldexp
  3609. ^double ldexp( double value, int exp )
  3610.  
  3611.  
  3612.  - prototype in math.h
  3613.  
  3614.  - returns value x 2**exp
  3615.  
  3616. :lfind
  3617. ^void *lfind(void *key,void *base,int *nelem,int width,int (*fcmp)())
  3618.  
  3619.  
  3620.  - prototype in stdlib.h
  3621.  
  3622.  - does linear search for items in an unsorted table;
  3623.  - base points to 0th element of table
  3624.  - nelem points to int containing number of entries in table
  3625.  - width contains number of bytes in each entry
  3626.  - key points to the search key
  3627.  - fcmp points to user-written comparison routine, where key and
  3628.    elem are passed to it as pointers.  fcmp returns:
  3629.  
  3630.     integer < 0 if search key < elem
  3631.     integer = 0 if equal
  3632.     integer > 0 if search key > elem
  3633.  
  3634.  - returns 0 if no match found, else address of first matching entry
  3635.  
  3636. :_lineto:_lineto_w
  3637. %        MSC: short far _lineto( short x, short y )
  3638. %        MSC: short far _lineto_w( double wx, double wy )
  3639.  
  3640.  
  3641.  - prototype in graph.h
  3642.  
  3643.  - draws a line from the current graphics position up to and
  3644.    including the point specified
  3645.  - current graphics position is then updated to (x,y)
  3646.  - returns nonzero if success; zero otherwise
  3647.  - Turbo C uses lineto()
  3648.  
  3649. :localtime
  3650. ^struct tm *localtime( const time_t *clock )
  3651.  
  3652.  
  3653.  - prototype in time.h
  3654.  
  3655.  
  3656.  - clock is a long int (such as that returned by time())
  3657.  - returns time in struct tm (see time.h) correcting for time zone
  3658.    and any daylight savings time
  3659.  - global variable timezone is difference in seconds between GMT
  3660.    and local standard time
  3661.  
  3662. :lock (c)
  3663. ^TC: int lock( int handle, long offset, long length )
  3664.  
  3665.  
  3666.  - prototype in io.h
  3667.  
  3668.   - locks arbitrary, non-overlapping regions of any file (DOS 3.X),
  3669.    preventing reads/writes to those regions
  3670.  - returns 0 on success, else -1 on error
  3671.  - all locks must be released before program termination
  3672.  - MS C uses locking()
  3673.  - see also unlock
  3674.  
  3675. :locking
  3676. ^MSC: int locking( int handle, int mode, long nbytes )
  3677.  
  3678.  
  3679.  - prototype in io.h, sys\locking.h
  3680.  
  3681.  - handle = opened file handle
  3682.  - nbytes = bytes to lock beginning with current file position
  3683.  - mode = locking mode:
  3684.         = LK_LOCK   locks region; on failure waits 1 sec and
  3685.                     attempts again;  tries 10 times
  3686.         = LK_RLCK   same as LK_LOCK
  3687.         = LK_NBLCK  locks region; returns immediately on error
  3688.         = LK_NBRLCK locks region; returns immediately on error
  3689.         = LK_UNLCK  unlock previously locked region
  3690.  
  3691.  - multiple locks may occur in a single file
  3692.  - overlapping locked regions are not allowed
  3693.  - returns 0 on success or -1 on failure
  3694.  
  3695.  - Turbo C uses lock() and unlock()
  3696.  
  3697. :log
  3698. ^double log( double x )
  3699.  
  3700.  
  3701.  - prototype in math.h
  3702.  
  3703.  - returns natural logarithm of x, or -HUGE_VAL on error
  3704.  
  3705. :log10
  3706. ^double log10( double x )
  3707.  
  3708.  
  3709.  - prototype in math.h
  3710.  
  3711.  - returns base 10 logarithm of x, or -HUGE_VAL on error
  3712.  
  3713. :longjmp
  3714. ^void longjmp( jmp_buf env, int id )
  3715.  
  3716.  
  3717.  - prototype in setjmp.h
  3718.  
  3719.  - call to longjmp() with env restores task state (set by setjmp()),
  3720.    returning value id
  3721.  - cannot return 0; if id == 0, returns 1
  3722.  
  3723. :_lrotl:_lrotr
  3724. ^MSC: unsigned long _lrotl( unsigned long value, int n )
  3725. ^MSC: unsigned long _lrotr( unsigned long value, int n )
  3726.  
  3727.  
  3728.  - prototype in stdlib.h
  3729.  
  3730.  - rotates long value by 'n' bits left or right
  3731.  - returns rotated value
  3732.  
  3733.  - see    _rotl   _rotr
  3734.  
  3735. :lsearch
  3736. ^void *lsearch(void *key,void *base,int *nelem,int width,int (*fcmp)())
  3737.  
  3738.  
  3739.  - prototype in stdlib.h
  3740.  
  3741.  - does linear search in unsorted table for key
  3742.  - base points to 0th element of table
  3743.  - nelem integer pointer to number of entries in table
  3744.  - width contains number of bytes in each entry
  3745.  - key points to the search key
  3746.  - fcmp points to comparison routine, where key and elem are passed
  3747.    to it as pointers.  fcmp returns:
  3748.  
  3749.       integer < 0 if search key < elem
  3750.       integer = 0 if equal;
  3751.       integer > 0 if search key > elem
  3752.  
  3753.  - returns 0 if no match found, else address of first matching entry
  3754.  
  3755. :lseek
  3756. ^long lseek( int fd, long offset, int mode )
  3757.  
  3758.  
  3759.  - prototype in io.h
  3760.  
  3761.  - sets file associated with fd to offset from
  3762.  
  3763.     mode = 0 - SEEK_SET beginning of file
  3764.     mode = 1 - SEEK_CUR current position
  3765.     mode = 2 - SEEK_END or end of file
  3766.  
  3767.  - returns -1L on error
  3768.  
  3769.  - see   tell
  3770. :ltoa
  3771. ^char *ltoa( long value, char *string, int radix )
  3772.  
  3773.  
  3774.  - prototype in stdlib.h
  3775.  
  3776.  - converts value to string where radix specifies
  3777.    base (2-36) for conversion
  3778.  
  3779. :_makepath
  3780. %   MSC: void _makepath( char *path, char *drive, char *dir,
  3781. %                        char *fname, char *ext )
  3782.  
  3783.  
  3784.  - prototype in stdlib.h
  3785.  
  3786.  - creates fully qualified filename from parts
  3787.  - path = receives fully qualified filename created from the parts
  3788.  - drive = drive letter string, with or without the colon
  3789.  - dir = directory name;  both slashes '/' or '\' are allowed;
  3790.    trailing slash is optional
  3791.  - fname = base file name w/o extension (max 8 bytes)
  3792.  - ext = file extension (max 3 bytes)
  3793.  
  3794.  - see  _splitpath
  3795.  
  3796. :malloc
  3797. ^void *malloc( unsigned size )
  3798.  
  3799.  
  3800.  - prototype in stdlib.h, alloc.h (malloc.h for MS C)
  3801.  
  3802.  - allocates memory of length size in bytes
  3803.  - returns pointer if successful, else NULL
  3804.  - MS C will return a zero length block (allocates header only)
  3805.  
  3806. :_matherr
  3807. %double _matherr( _mexcep why, char *fun, double *arg1p,
  3808. %                 double *arg2p, double retval )
  3809.  
  3810.  
  3811.  - prototype in math.h
  3812.  
  3813.  - used with matherr(), calling matherr() and processes the return
  3814.    value from matherr()
  3815.  - floating point error handling routine
  3816.  
  3817. :matherr
  3818. ^int matherr( struct exception *e )
  3819.  
  3820.  
  3821.  - prototype in math.h
  3822.  
  3823.  - provided as customizable math error-handling routine
  3824.  
  3825. :mem...:mem
  3826. ^Memory Manipulation Functions
  3827.  
  3828.  
  3829.  void  *memccpy( void *dest, const void *src, int c, size_t n )
  3830.  void  *memchr( const void *s, int c, size_t n )
  3831.  int   memcmp( const void *s1, const void *s2, size_t n )
  3832.  void  *memcpy( void *dest, const void *src, size_t n )
  3833.  int   memicmp( const void *s1, const void *s2, size_t n )
  3834.  void  *memmove( void *dest, const void *src, size_t n )
  3835.  void  *memset( void *s, int c, size_t n )
  3836.  void  movedata( unsigned srcseg, unsigned srcoff,
  3837.                  unsigned dstseg, unsigned dstoff, size_t n )
  3838.  
  3839.  - prototypes for the preceding functions are in mem.h, string.h
  3840.  - prototyped in mem.h only:
  3841.  
  3842.  void  movmem( void *src, void *dest, unsigned length ); (mem.h only)
  3843.  void  setmem( void *dest, unsigned length, char value ); (mem.h only)
  3844.  
  3845.  
  3846. :_memavl
  3847. ^MSC: size_t _memavl( void )
  3848.  
  3849.  
  3850.  - prototype in malloc.h
  3851.  
  3852.  - returns size in bytes of memory available in the default
  3853.    data segment
  3854.  
  3855. :memccpy
  3856. ^void *memccpy(void *dest, const void *src, int ch, size_t n)
  3857.  
  3858.  
  3859.  - prototype in string.h, mem.h
  3860.  
  3861.  - copies from src to dest until ch is copied or n bytes are copied
  3862.    returning a ptr to byte in dest immediately following ch or NULL
  3863.  
  3864. :memchr
  3865. ^void *memchr( const void *s, int ch, size_t n )
  3866.  
  3867.  
  3868.  - prototype in string.h, mem.h
  3869.  
  3870.  - searches first n bytes in s for ch, returning pointer to first
  3871.    occurrence or NULL if not found
  3872.  
  3873. :memcmp
  3874. ^int memcmp( const void *s1, const void *s2, size_t n )
  3875.  
  3876.  
  3877.  - prototype in string.h, mem.h
  3878.  
  3879.  - compares two strings s1 & s2 for a length of n bytes,
  3880.    returning a value:
  3881.  
  3882.                 < 0   if s1 < s2
  3883.                 = 0   if s1 = s2
  3884.                 > 0   if s1 > s2
  3885.  
  3886. :memcpy
  3887. ^void *memcpy( void *dest, const void *src, size_t n )
  3888.  
  3889.  
  3890.  - prototype in string.h, mem.h
  3891.  
  3892.  - copies n bytes from src to dest; returns dest
  3893.  - if overlap occurs, result is undefined (ANSI)
  3894.  
  3895. :memicmp
  3896. ^int memicmp( const void *s1, const void *s2, size_t n )
  3897.  
  3898.  
  3899.  - prototype in string.h, mem.h
  3900.  
  3901.  - compares first n bytes of s1 & s2, case insensitive
  3902.  
  3903. :memmove
  3904. ^void *memmove( void *dest, const void *src, size_t n )
  3905.  
  3906.  
  3907.  - prototype in string.h, mem.h
  3908.  
  3909.  - copies n bytes from src to dest; returns dest
  3910.  - allows copying overlapped strings (ANSI)
  3911.  
  3912. :memset
  3913. ^void *memset( void *s, int ch, size_t n )
  3914.  
  3915.  
  3916.  - prototype in string.h, mem.h
  3917.  
  3918.  - memset sets all bytes of s to byte ch, with size of s = n;
  3919.    returns value of s
  3920.  
  3921. :mk_fp
  3922. ^void far *MK_FP( unsigned segment, unsigned offset )
  3923.  
  3924.  
  3925.  - prototype in dos.h
  3926.  
  3927.  - returns a far pointer from offset and segment
  3928.  
  3929.  
  3930.  
  3931.  - not available in some Microsoft C versions; use the following:
  3932.  
  3933.  
  3934.  #define MK_FP(seg,off) \
  3935.   ((void far *) (((unsigned long)(seg) << 16) | (unsigned)(off))
  3936.  
  3937. :mkdir
  3938. ^int mkdir( const char *pathname )
  3939.  
  3940.  
  3941.  - prototype in dir.h
  3942.  
  3943.  - takes pathname & creates new directory with that name
  3944.  - returns 0 if successful, else -1
  3945.  
  3946. :mktemp
  3947. ^char *mktemp( char *template )
  3948.  
  3949.  
  3950.  - prototype in dir.h
  3951.  
  3952.  - replaces template by unique file name & returns address of
  3953.    template if successful
  3954.  - template should be string with six trailing Xs
  3955.  
  3956. :modf
  3957. ^double modf( double value, double *iptr )
  3958.  
  3959.  
  3960.  - prototype in math.h
  3961.  
  3962.  - splits value in integer and fraction part, storing integer part
  3963.    in area pointed to by iptr, returning the fractional part
  3964.  
  3965. :movedata
  3966. %     void movedata( unsigned segsrc, unsigned offsrc,
  3967. %                    unsigned segdest, unsigned offdest, size_t n )
  3968.  
  3969.  
  3970.  - prototype in mem.h, string.h
  3971.  
  3972.  - copies n bytes from segsrc:offsrc to segdest:offdest
  3973.  
  3974. :_moveto:_moveto_w
  3975. % MSC: struct xycoord far _moveto( short x, short y )
  3976. % MSC: struct _wxycoord far _moveto_w ( double wx, double wy )
  3977.  
  3978.  
  3979.  - prototype in graph.h
  3980.  
  3981.  - moves current drawing position to specified coordinates
  3982.  - returns previous coordinates in the following structures:
  3983.  
  3984.  struct xycoord         struct _wxycoord
  3985.     {                      {
  3986.     short xcoord;          double wx;   /* window x coord */
  3987.     short ycoord;          double wy;   /* window y coord */
  3988.     };                     };
  3989.  
  3990.  - see  _lineto
  3991.  
  3992. :movmem
  3993. ^void movmem( void *src, void *dest, unsigned len )
  3994.  
  3995.  
  3996.  - prototype in mem.h
  3997.  
  3998.  - copies len bytes from src to dest
  3999.  
  4000. :_msize:_bmsize:_fmsize:_nmsize
  4001. %MSC: size_t _msize( void *block )
  4002. %MSC: size_t _bmsize( _segment seg, void _based( void ) *block )
  4003. %MSC: size_t _fmsize( void far *block )
  4004. %MSC: size_t _nmsize( void near *block )
  4005.  
  4006.  
  4007.  - prototype in malloc.h
  4008.  
  4009.  - returns size of memory block in bytes
  4010.  - _msize() maps to other function depending on memory model
  4011.  
  4012. :_open
  4013. ^TC: int _open( const char *path, int access )
  4014.  
  4015.  
  4016.  - prototype in io.h, also include fcntl.h
  4017.  
  4018.  - this function will not create a file, use _creat() if it doesn't
  4019.    currently exist
  4020.  - access is a combination of the following:
  4021.  
  4022. %  DOS 2.0+ Attributes
  4023.     O_RDONLY     open read only
  4024.     O_WRONLY     open write only
  4025.     O_RDWR       open read/write
  4026.  
  4027. %  DOS 3.1+ Attributes
  4028.     O_NOINHERIT  file is not to be passed to child processes
  4029.     O_DENYALL    file is not accessible to other opens (open exclusive)
  4030.     O_DENYWRITE  file is read only to all other opens
  4031.     O_DENYREAD   file is write only to all other opens
  4032.     O_DENYNONE   file is to be shared by all
  4033.  
  4034.  - MS C uses _dos_open()
  4035.  - see   INT 21,3D   open   _creat
  4036.  
  4037. :onexit
  4038. ^MSC: onexit_t onexit( onexit_t func )
  4039.  
  4040.  
  4041.  - prototype in stdlib.h
  4042.  
  4043.  - creates a list of functions to execute on normal program exit
  4044.  - on exit functions are executed LIFO
  4045.  - a max of 32 function can be registered
  4046.  - returns pointer to "func" on success;  NULL otherwise
  4047.  - this is a Microsoft/Lattice extension; ANSI uses atexit()
  4048.  
  4049.  - see   atexit   exit   abort
  4050.  
  4051. :open
  4052. ^int open( const char *path, int access [, unsigned permis] )
  4053.  
  4054.  - prototype in io.h, also include stat.h & fcntl.h
  4055.  
  4056.  - open attribute flags are defined in fcntl.h
  4057.  - opens file "path" with access and optionally permis
  4058.  - access is a combination of the following ("permis" follows):
  4059.  
  4060. %  Read/Write Access Flags (mutually exclusive):
  4061.     O_RDONLY   open read only
  4062.     O_WRONLY   open write only
  4063.     O_RDWR     open read/write
  4064.  
  4065. %  Other Access Mode Flags:
  4066.     O_APPEND   file pointer is placed at EOF before each write
  4067.     O_CREAT    if file doesn't exist, create with "permis" attributes
  4068.     O_TRUNC    if exists, truncate length to zero, but leave file
  4069.                attributes unchanged
  4070.     O_BINARY   binary mode
  4071.     O_TEXT     text mode
  4072.     O_EXCL     used with O_CREAT, error occurs if file already exists
  4073.     O_NDELAY   UNIX only
  4074.  
  4075. %  Permission Attributes (if creating):
  4076.     S_IWRITE   write permission
  4077.     S_IREAD    read permission
  4078.     S_IREAD | S_IWRITE read/write permission
  4079.   
  4080.  - if O_BINARY nor O_TEXT is given, file is opened in translation
  4081.    mode (O_TEXT) given by global variable _fmode
  4082.  - returns nonnegative number as file HANDLE, or -1 on error
  4083.  - see   sopen
  4084. :outp:outpw
  4085. %        MSC: int outp( unsigned port, int datab )
  4086. %        MSC: unsigned outpw(unsigned port, unsigned dataw )
  4087.  
  4088.  
  4089.  - prototype in conio.h
  4090.  
  4091.  - write data value to port specified in port
  4092.  - port = hardware I/O port
  4093.  - datab = byte value to write
  4094.  - dataw = word value to write
  4095.  
  4096.  - Turbo C uses outportb() and outport()
  4097.  
  4098. :outport
  4099. ^TC: void outport( int port, int word )
  4100.  
  4101.  
  4102.  - prototype in dos.h
  4103.  
  4104.  - outport() writes word to output port port
  4105.  - MS C uses outpw()
  4106.  - see outportb()
  4107.  
  4108. :outportb
  4109. ^TC: void outportb( int port, unsigned char byte )
  4110.  
  4111.  
  4112.  - prototype in dos.h
  4113.  
  4114.  - outportb() is macro that writes byte to output port port
  4115.  - MS C uses outp()
  4116.  - see outport()
  4117.  
  4118. :_outtext
  4119. ^MSC: void far _outtext( unsigned char far *text )
  4120.  
  4121.  
  4122.  - prototype in graph.h
  4123.  
  4124.  - writes string in "text' to the graphics display
  4125.  
  4126. :parsfnm
  4127. %    TC: char *parsfnm( const char *cmdline, struct fcb *fcbptr,
  4128. %                       int option )
  4129.  
  4130.  
  4131.  - prototype in dos.h
  4132.  
  4133.  - parses command line cmdline for a file name, placing it into a
  4134.    FCB as drive/filename/file ext, pointed to by fcbptr
  4135.  - option is same as for AL in MS-DOS function call 0x29
  4136.  - returns pointer to byte beyond end of filename, 0=error
  4137.  
  4138. :peek
  4139. ^TC: int peek( unsigned seg, unsigned off )
  4140.  
  4141.  
  4142.  - prototype in dos.h
  4143.  
  4144.  - returns word found at seg:off
  4145.  
  4146. :peekb
  4147. ^TC: char peekb( unsigned seg, unsigned off )
  4148.  
  4149.  
  4150.  - prototype in dos.h
  4151.  
  4152.  - returns byte found at seg:off
  4153.  
  4154. :perror
  4155. ^void perror( const char *string )
  4156.  
  4157.  
  4158.  - prototype in stdio.h
  4159.  
  4160.  - prints error message to stderr, describing most recent call
  4161.    found in system call from current program
  4162.  
  4163. :_pie:_pie_wxy
  4164. %MSC: short _pie( short control, short x1, short y1, short x2,
  4165. %                 short y2, short x3, short y3, short x4, short y4 )
  4166.  
  4167. %MSC: short far _pie_wxy( short ctl,
  4168. %                   struct _wxycoord far *pwxy1,
  4169. %                   struct _wxycoord far *pwxy2,
  4170. %                   struct _wxycoord far *pwxy3,
  4171. %                   struct _wxycoord far *pwxy4 )
  4172.  
  4173.  - prototype in graph.h
  4174.  
  4175.  - (x1, y1) upper left rectangle corner
  4176.  - (x2, y2) lower right rectangle corner
  4177.  - (x3, y3) start of vector
  4178.  - (x4, y4) end of vector
  4179.  - ctl = _GFILLINTERIOR  fills region with current color and mask
  4180.          _GBORDER  don't fill region
  4181.  
  4182.  - returns nonzero value on success; zero otherwise
  4183.  
  4184. :poke
  4185. ^TC: void poke( unsigned seg, unsigned off, int value )
  4186.  
  4187.  
  4188.  - prototype in dos.h
  4189.  
  4190.  - writes word value to location seg:off
  4191.  
  4192. :pokeb
  4193. ^TC: void pokeb( unsigned seg, unsigned off, char value )
  4194.  
  4195.  
  4196.  - prototype in dos.h
  4197.  
  4198.  - writes byte value to location seg:off
  4199.  
  4200. :poly
  4201. ^double poly( double x, int n, double coeff[] )
  4202.  
  4203.  
  4204.  - prototype in math.h
  4205.  
  4206.  - generates polynominal in x of degree n, with coefficients coeff,
  4207.    returning the value of this polynominal evaluated for x
  4208.  
  4209. :pow
  4210. ^double pow( double x, double y )
  4211.  
  4212.  
  4213.  - prototype in math.h
  4214.  
  4215.  - returns p where p = x ** y or +/- HUGE_VAL on error
  4216.  
  4217. :pow10
  4218. ^double pow10( double x )
  4219.  
  4220.  
  4221.  - prototype in math.h
  4222.  
  4223.  - returns y where y = 10 ** x or HUGE_VAL on overflow error
  4224.  
  4225. :printf
  4226. ^int printf( const char *format [, arg1, arg2, ...] )
  4227.  
  4228.  
  4229.  - prototype in stdio.h
  4230.  
  4231.  - printf formatted string
  4232.  
  4233.  
  4234.  - see  PRINTF SPEC  for format specifiers
  4235.  
  4236. :printf specifiers
  4237. ^Specifications for printf()
  4238.  
  4239. %%[-][+][space][#][width][.prec][size]type
  4240.  
  4241. %Field                  Description
  4242.  
  4243.    -         left justify
  4244.    +         prefix positive numbers with '+', overrides blank
  4245.    space     prefix positive numbers with space
  4246.    #         prefix octal or hex with 0, (see manual for Turbo C)
  4247.    width     width of output string in total characters, a 0 before
  4248.              width causes padding with zeros on left.
  4249.    .prec     decimal precision in characters
  4250.    size      F   far pointer
  4251.              N   near pointer
  4252.              h   specifies short
  4253.              l   specifies long
  4254.              L   long double
  4255.    type      c   single character
  4256.              d   signed decimal integer
  4257.              e   signed exponential, 'e' is output in string
  4258.              E   signed exponential, 'E' is output in string
  4259.              f   signed floating point in form of sddd.ddd
  4260.              g   formats e or f (depends on size), e is output
  4261.              G   formats e or f (depends on size), E is output
  4262.              i   signed decimal integer
  4263.              n   integer pointer
  4264.              o   unsigned octal integer
  4265.              p   void pointer;  MS C always uses far pointers, in
  4266.                  Turbo C, size is dependent on memory model
  4267.              s   string pointer
  4268.              u   unsigned decimal integer
  4269.              x   unsigned integer in lower case hex format
  4270.              X   unsigned integer in upper case hex format
  4271.  
  4272.  - if width or precision are specified as an asterisk '*', an int
  4273.    from the argument list is used as the width or precision. If the
  4274.    width is too small the field is expanded.
  4275. :putc
  4276. ^int putc( int c, FILE *fd )
  4277.  
  4278.  
  4279.  - prototype in stdio.h
  4280.  
  4281.  - puts char c to stream fd, returning c on success, else
  4282.    returns EOF on error
  4283.  
  4284. :putch
  4285. ^int putch( int ch )
  4286.  
  4287.  
  4288.  - prototype in conio.h
  4289.  
  4290.  - puts char ch to console with BEL, BS, TAB, LF and BEL characters
  4291.    are converted similar to DOS I/O
  4292.  - TC uses direct video or BIOS depending on value of external
  4293.    variable directvideo
  4294.  - returns nothing
  4295.  
  4296. :putchar
  4297. ^int putchar( char c )
  4298.  
  4299.  
  4300.  - prototype in stdio.h
  4301.  
  4302.  - same as putc(c,stdout)
  4303.  
  4304. :putenv
  4305. ^int putenv( const char *envvar )
  4306.  
  4307.  
  4308.  - prototype in stdlib.h
  4309.  
  4310.  - adds string to environment
  4311.  - DOS environment consists of strings of form envvar=varvalue,...
  4312.  - returns 0 if OK
  4313.            1 on failure
  4314.  
  4315. :_putimage:_putimage_w
  4316. %MSC: void _putimage( short x, short y, char huge *image,
  4317. %                     short action )
  4318.  
  4319. %MSC: void far _putimage_w( double wx, double wy,
  4320. %                       char huge *image, short action )
  4321.  
  4322.  - prototype in graph.h
  4323.  
  4324.  - restores previously saved screen image to screen
  4325.  - (x, y) upper left corner of image
  4326.  - image = buffer containing previously saved image
  4327.  - action = defines interaction between current screen buffer and
  4328.             the data stored in "image"
  4329.           = _GAND    AND image with current screen
  4330.           = _GOR     OR image with current screen
  4331.           = _GPRESET overwrite current screen with inverse of image
  4332.           = _GPSET   overwrite current screen with exact image
  4333.           = _GXOR    XOR's image to current screen
  4334.  
  4335.  - Turbo C uses putimage()
  4336.  - see   _getimage   _imagesize
  4337.  
  4338. :putimage
  4339. ^void far putimage( int left, int top, void far *bitmap, int option )
  4340.  
  4341.  - prototype in graphics.h
  4342.  
  4343.  - left and top represent the upper left corner of the area the
  4344.    bitmap data will be placed
  4345.  
  4346.  - op may be one of the following:
  4347.      COPY_PUT copy data from bitmap to screen and erasing contents
  4348.      XOR_PUT  xor data in bitmap with current screen
  4349.      OR_PUT   or data in bitmap with current screen
  4350.      AND_PUT  and data in bitmap with current screen
  4351.      NOT_PUT  similar to COPY_PUT, but inverse of data
  4352.  
  4353.  - the getimage()/putimage() buffer has the following format:
  4354.      00  width of image  (WORD)
  4355.      02  height of image  (WORD)
  4356.      04  actual bitmap pixel data, format and size is related to
  4357.          video mode and dimensions
  4358.  
  4359.  - see GETIMAGE
  4360.  
  4361. :puts
  4362. ^int puts( const char *string )
  4363.  
  4364.  
  4365.  - prototype in stdio.h
  4366.  
  4367.  - copies string to stdout and appends a newline
  4368.  
  4369. :putw
  4370. ^int putw( int n, FILE *fd )
  4371.  
  4372.  
  4373.  - prototype in stdio.h
  4374.  
  4375.  - puts integer word n to stream fd
  4376.  - returns n or EOF on error.  Use ferror() to verify
  4377.    if EOF is returned, since -1 is a legitimate integer.
  4378.  
  4379. :qsort
  4380. %     void qsort( void *array, size_t n_elem, size_t elem_size,
  4381. %                 int (*fcmp)(const void *, const void *) )
  4382.  
  4383.  
  4384.  - prototype in stdlib.h
  4385.  
  4386.  - sorts the given array using the ACM quick sort routine
  4387.  - fcmp() is the same as for bsearch()
  4388.  
  4389. :raise
  4390. ^MSC: int raise( int sig )
  4391.  
  4392.  
  4393.  - prototype in signal.h
  4394.  
  4395.  - raises signal 'sig' to program:
  4396.  
  4397.    SIGABRT  signal abnormal termination
  4398.    SIGILL   signal illegal instruction
  4399.    SIGSEGV  signal illegal storage access
  4400.    SIGFPE   signal floating point error
  4401.    SIGINT   signal Ctrl-Break interrupt
  4402.    SIGTERM  signal program termination (ignored in MS DOS)
  4403.    SIGUSR1  SIGUSR2  SIGUSR3  user signals
  4404.  
  4405.  - returns 0 on success; nonzero otherwise
  4406.  
  4407.  - see   signal
  4408.  
  4409. :rand
  4410. %              int rand( void )
  4411. %              void srand( unsigned seed )
  4412.  
  4413.  
  4414.  - prototype in stdlib.h
  4415.  
  4416.  - rand() returns pseudorandom numbers
  4417.  - re-initialize generator with srand(1) or set to new starting
  4418.    point with seed set other than to 1
  4419.  
  4420. :randbrd
  4421. ^TC: int randbrd( struct fcb *fcbptr, int reccnt )
  4422.  
  4423.  
  4424.  - prototype in dos.h
  4425.  
  4426.  - randbrd() reads reccnt number of records using the open FCB via
  4427.    fcbptr, as indicated by the disk record field of the FCB (via
  4428.    DOS call 0x27).
  4429.  - returns:
  4430.    0  all records read(written)
  4431.    1  EOF reached & last record read is complete
  4432.    2  reading records would have wrapped around address 0xffff
  4433.    3  EOF reached & last record is incomplete
  4434.  - see also randbrw()
  4435.  
  4436. :randbrw
  4437. ^TC: int randbrw( struct fcb *fcbptr, int reccnt )
  4438.  
  4439.  
  4440.  - prototype in dos.h
  4441.  
  4442.  - randbrw() returns 1 if there is not enough disk space to write
  4443.    the records (no records are written)
  4444.  - see randbrd()
  4445.  
  4446. :_read
  4447. ^TC: int _read( int fd, void *buf, int size )
  4448.  
  4449.  
  4450.  - prototype in io.h
  4451.  
  4452.  - reads size bytes from file handle fd into buf
  4453.  - size must be less than 65534 bytes
  4454.  - is a direct call to MS-DOS read function INT 21,3F
  4455.  - does not translate CR/LF;  all input in binary
  4456.  - returns number of bytes successfully transferred or -1
  4457.  - MS C uses _dos_read()
  4458.  
  4459.  - see   read   _open   _creat   _write   _close   INT 21,3F
  4460.  
  4461. :read
  4462. ^int read( int fd, char *buf, int size )
  4463.  
  4464.  
  4465.  - prototype in io.h
  4466.  
  4467.  - reads size bytes from file handle fd into buf
  4468.  - removes CRs & reports EOF on a CNTL-Z for text mode file
  4469.  - returns number of bytes read, 0 on EOF, or -1 on error
  4470.  
  4471. :realloc
  4472. ^void *realloc( void *pseg, unsigned size )
  4473.  
  4474.  
  4475.  - prototype in stdlib.h & alloc.h (malloc.h for MS C)
  4476.  
  4477.  - see malloc()
  4478.  
  4479. :_rectangle:_rectangle_w:_rectangle_wxy
  4480. %MSC: short _rectangle( short ctl, short x1, short y1,
  4481. %                       short x2, short y2 )
  4482.  
  4483. %MSC: short far _rectangle_w( short control, double wx1,
  4484. %           double wy1, double wx2, double wy2 )
  4485.  
  4486. %MSC: short far _rectangle_wxy( short control,
  4487. %     struct _wxycoord far *pwxy1, struct _wxycoord far *pwxy2 )
  4488.  
  4489.  
  4490.  - prototype in graph.h
  4491.  
  4492.  - (x1,y1) upper left corner of rectangle
  4493.  - (x2,y2) lower right corner of rectangle
  4494.  - ctl = _GFILLINTERIOR  fill rectangle with current color and mask
  4495.        = _GBORDER        don't fill rectangle
  4496.  
  4497.  - returns nonzero on success; zero otherwise
  4498.  
  4499. :_remapallpalette:_remappalette
  4500. ^MSC: short far _remapallpalette( long far *colors )
  4501. ^MSC: long far _remappalette( short pixnum, long color )
  4502.  
  4503.  - prototype in graph.h
  4504.  
  4505.  - colors = color number array containing one color per video
  4506.             mode color
  4507.  - pixnum = pixel to change
  4508.  - color = new color number
  4509.  
  4510. %Valid colors are:
  4511.  
  4512.    _BLACK        _BLUE          _BRIGHTWHITE     _BROWN
  4513.    _CYAN         _GRAY          _GREEN           _LIGHTBLUE
  4514.    _LIGHTCYAN    _LIGHTGREEN    _LIGHTMAGENTA    _LIGHTRED
  4515.    _YELLOW       _MAGENTA       _RED             _WHITE
  4516.  
  4517.  - _remapallpalette() remaps all pixel values; _remappalette() affects
  4518.    on the pixel specified by pixnum
  4519.  - _remapallpalette() returns -1 on success; zero otherwise
  4520.  - _remappalette() previous color value of "pixnum" on success; -1
  4521.    otherwise
  4522.  
  4523. :remove
  4524. ^int remove( char *filename )
  4525.  
  4526.  
  4527.  - prototype in stdio.h
  4528.  
  4529.  - implemented as a macro of function unlink()
  4530.  
  4531. :rename
  4532. ^int rename( const char *oldf, const char *newf )
  4533.  
  4534.  
  4535.  - prototype in stdio.h
  4536.  
  4537.  - rename file from oldf to newf
  4538.  - returns 0 if OK, else -1 on error
  4539.  
  4540. :rewind
  4541. ^void rewind( FILE *fd )
  4542.  
  4543.  
  4544.  - prototype in stdio.h
  4545.  
  4546.  - equivalent to fseek(fd,0L,0), except eof and error indicators
  4547.    are cleared
  4548.  - returns 0 if pointer moved OK, else nonzero
  4549.  
  4550. :rmdir
  4551. ^int rmdir( const char *path )
  4552.  
  4553.  
  4554.  - prototype in dir.h
  4555.  
  4556.  - takes path & deletes directory with that name
  4557.  - returns 0 if successful, else -1
  4558.  
  4559. :rmtmp
  4560. ^MSC: int rmtmp( void )
  4561.  
  4562.  
  4563.  - prototype in stdio.h
  4564.  
  4565.  - cleans up all temporary files in the current directory created
  4566.    by tmpfile()
  4567.  - should only be used on files in the current directory
  4568.  - returns number of temporary files closed and deleted
  4569.  
  4570. :_rotl:_rotr
  4571. ^MSC: unsigned _rotl( unsigned value, int shift )
  4572. ^MSC: unsigned _rotr( unsigned value, int shift )
  4573.  
  4574.  
  4575.  - prototype in stdlib.h
  4576.  
  4577.  - rotates value by 'n' bits left or right
  4578.  - returns rotated value
  4579.  
  4580.  - see    _lrotl   _lrotr
  4581.  
  4582. :sbrk
  4583. ^void *sbrk( int incr )
  4584.  
  4585.  
  4586.  - prototype in alloc.h (malloc.h for MS C)
  4587.  
  4588.  - dynamically changes the amount of space allocated to the calling
  4589.    programs data segment.  Amount of allocated space is increased by
  4590.    amount incr (can be negative).
  4591.  
  4592.  - returns 0 if OK
  4593.           -1 & errno is set to ENOMEM
  4594.  
  4595. :scanf
  4596. ^int scanf( const char *format, arg1, arg2, ... )
  4597.  
  4598.  
  4599.  - prototype in stdio.h
  4600.  
  4601.  - accepts input from stdin and converts to format specs
  4602.  
  4603.  
  4604.  - see SCANF SPECS
  4605.  
  4606. :scanf specifiers
  4607. ^Specifications for scanf()
  4608.  
  4609. %%[*][width][size]type
  4610.  
  4611. %Field                     Description
  4612.  
  4613.    *             read next field but suppress assignment
  4614.    width         maximum number of characters to read
  4615.    size      F   far pointer
  4616.              N   near pointer
  4617.              h   specifies short
  4618.              l   specifies long
  4619.    type      %   prints % character
  4620.              c   character data
  4621.              d   signed decimal integer
  4622.              D   signed long int
  4623.              e,E signed exponential
  4624.              f   signed floating point in form of sddd.ddd
  4625.              g,G used for e and f formats
  4626.              i   signed decimal, octal or hex integer
  4627.              I   signed decimal, octal, or hex long integer
  4628.              n   integer pointer
  4629.              o   unsigned octal integer
  4630.              O   unsigned octal long integer
  4631.              p   void pointer;  MS C always uses far pointers, in
  4632.                  Turbo C, size is dependent on memory model
  4633.              s   string pointer
  4634.              u   unsigned decimal integer
  4635.              U   unsigned decimal long integer
  4636.              x   unsigned hexadecimal integer
  4637.              X   unsigned hexadecimal long integer
  4638.  
  4639. :_searchenv
  4640. ^MSC: void _searchenv( char *fname, char *var, char *path )
  4641.  
  4642.  
  4643.  - prototype in stdlib.h
  4644.  
  4645.  - searches for "fname" in environment variable "var"
  4646.  - fname = name of file to search for
  4647.  - var = environment variable to use for search
  4648.  - path = receives path if file found
  4649.  - attempts to locate filename using MS-DOS file search strategy
  4650.  
  4651.  - Turbo C uses searchpath()
  4652.  
  4653. :searchpath
  4654. ^TC: char *searchpath( const char *filename )
  4655.  
  4656.  
  4657.  - prototype in dir.h
  4658.  
  4659.  - filename = name of file to search for
  4660.  - attempts to locate filename using MS-DOS path using standard
  4661.    DOS file search strategy
  4662.  - returns pointer to full pathname for filename (in a static
  4663.    array) or NULL if not found
  4664.  - MS C uses _searchenv()
  4665.  
  4666. :segread
  4667. ^void segread( struct SREGS *segregs )
  4668.  
  4669.  
  4670.  - prototype in dos.h
  4671.  
  4672.  - places current values of segment registers (SEGREGS) into segtbl
  4673.  - available in Turbo C and MS C
  4674.  - unique to DOS
  4675.  - see  REGS
  4676.  
  4677. :_selectpalette
  4678. ^MSC: short far _selectpalette( short palette )
  4679.  
  4680.  
  4681.  - prototype in graph.h
  4682.  
  4683.  - palette = palette number
  4684.  - works only in MRES4COLOR and MRESNOCOLOR video modes
  4685.  - returns value of previous palette
  4686.  
  4687. :_setactivepage
  4688. ^MSC: short far _setactivepage( short page )
  4689.  
  4690.  
  4691.  - prototype in graph.h
  4692.  
  4693.  - page = memory page where graphics output will be written
  4694.  - if successful returns page number of former active page or
  4695.    negative value on failure
  4696.  - swapping video pages is a good method of handling animation
  4697.  
  4698. :_setbkcolor
  4699. ^MSC: long far _setbkcolor( long color )
  4700.  
  4701.  
  4702.  - prototype in graph.h
  4703.  
  4704.  - color = new color for background
  4705.  - returns previous background color
  4706.  
  4707. :setblock
  4708. ^TC: int setblock( unsigned seg, unsigned newsize )
  4709.  
  4710.  
  4711.  - prototype in dos.h
  4712.  
  4713.  - modifies size of previously allocated DOS memory segment
  4714.  - MSC uses _dos_setblock()
  4715.  - see INT 21,4A
  4716.  
  4717. :setbuf
  4718. ^void setbuf( FILE *stream, char *buf )
  4719.  
  4720.  
  4721.  - prototype in stdio.h
  4722.  
  4723.  - causes buf to be used for I/O buffering instead of the
  4724.    automatically allocated buffer, and are used after given
  4725.    stream is opened
  4726.  - if buf is NULL, I/O is unbuffered
  4727.  - no I/O to the file should occur after opening file until
  4728.    buffering is set
  4729.  
  4730.  - see SETVBUF
  4731.  
  4732. :setcbrk
  4733. ^TC: int setcbrk( int value )
  4734.  
  4735.  
  4736.  - prototype in dos.h
  4737.  
  4738.  - sets control-break setting (value = 0 sets cntl-C checking off
  4739.    except for during console and printer I/O; value = 1 always
  4740.    check during DOS calls)
  4741.  
  4742. :_setcliprgn
  4743. ^MSC: void far _setcliprgn( short x1, short y1, short x2, short y2 )
  4744.  
  4745.  
  4746.  - prototype in graph.h
  4747.  
  4748.  - all graphics output to the screen is limited to the specified
  4749.    region;  output to areas other than this area is clipped
  4750.  - (x1,y1) upper left corner of clipping region
  4751.  - (x1,y1) lower right corner of clipping region
  4752.  
  4753. :_setcolor
  4754. ^MSC: short far _setcolor( short color )
  4755.  
  4756.  
  4757.  - prototype in graph.h
  4758.  
  4759.  - color = new color value
  4760.  - returns previous color index or -1 on error
  4761.  - all subsequent graphics calls will use the specified color
  4762.  
  4763. :setdate
  4764. ^TC: void setdate( struct date *dateblk )
  4765.  
  4766.  
  4767.  - prototype in dos.h
  4768.  
  4769.  - sets DOS date via INT 21,2B
  4770.  - DOS 3.3+ also sets CMOS clock
  4771.  
  4772.  - MS C uses _dos_setdate()
  4773.  - see INT 21,2B
  4774.  
  4775. :setdisk
  4776. ^TC: int setdisk( int drive )
  4777.  
  4778.  
  4779.  - prototype in dir.h
  4780.  
  4781.  - set current drive to set as default;  0 = A:, 1 = B:, ...
  4782.  - returns total number of drives available
  4783.  
  4784.  - MS C uses _dos_setdrive()
  4785.  - see  INT 21,E
  4786.  
  4787. :setdta
  4788. ^TC: void setdta( char far *dta )
  4789.  
  4790.  
  4791.  - prototype in dos.h
  4792.  
  4793.  - changes current setting of the DTA as given by DTA
  4794.  - no corresponding function in MS C
  4795.  
  4796. :_setfillmask
  4797. ^MSC: void far _setfillmask( unsigned char far *mask )
  4798.  
  4799.  
  4800.  - prototype in graph.h
  4801.  
  4802.  - mask =  8 by 8 bit fill mask array
  4803.  - sets the fill mask used to fill screen regions
  4804.  - any bit set to 1 will have the default color; any bit cleared
  4805.    to zero leaves the pixel unchanged
  4806.  - when no fill mask is set (NULL), the default color only is used
  4807.  
  4808. :_setfont
  4809. ^MSC: short far _setfont( unsigned char far *options )
  4810.  
  4811.  
  4812.  - prototype in graph.h
  4813.  
  4814.  - returns font with matching "options"
  4815.    returns negative value on error
  4816.    -1  Font not registered
  4817.    -4  not enough memory for font
  4818. :setftime
  4819. ^TC: int setftime( int handle, struct ftime *ftimep )
  4820.  
  4821.  
  4822.  - prototype in dos.h
  4823.  
  4824.  - sets file time and date for the file associated with handle as
  4825.    defined by ftimep
  4826.  - structure ftime is defined in dos.h
  4827.  - MS C uses _dos_setftime()
  4828.  - see INT 21,57
  4829.  
  4830. :setjmp
  4831. ^int setjmp( jmp_buf env )
  4832.  
  4833.  
  4834.  - prototype in setjmp.h
  4835.  
  4836.  - captures callers task state in env and returns 0
  4837.  - see also longjmp()
  4838.  
  4839. :_setlinestyle
  4840. ^MSC: void far _setlinestyle( unsigned short mask )
  4841.  
  4842.  
  4843.  - prototype in graph.h
  4844.  
  4845.  - each 1 bit represents a pixel (in current color) in the line
  4846.    mask;  each 0 represent a pixel that is left alone
  4847.  - default line style is FFFFh
  4848.  
  4849.  - see   _getlinestyle
  4850.  
  4851. :_setlogorg:_setvieworg
  4852. ^struct xycoord far _setlogorg( short x, short y )
  4853.  
  4854.  
  4855.  - prototype in graph.h
  4856.  
  4857.  - moves the logical origin (0,0) to the physical point (x,y)
  4858.  - returns previous logical origin in physical coordinates to:
  4859.  
  4860.     struct xycoord
  4861.        {
  4862.        short xcoord;
  4863.        short ycoord;
  4864.        };
  4865.  
  4866. :setmem
  4867. ^void setmem( void *addr, int len, char value )
  4868.  
  4869.  
  4870.  - prototype in mem.h
  4871.  
  4872.  - sets len bytes in addr to value
  4873.  
  4874. :setmode
  4875. ^int setmode( int handle, int mode )
  4876.  
  4877.  
  4878.  - prototype in io.h
  4879.  
  4880.  - sets mode of file associated with handle to binary (O_BINARY) or
  4881.    text (O_TEXT) but not both
  4882.  - returns 0 if successful, else -1 on error
  4883.  
  4884. :_setpixel:_setpixel_w
  4885. %     MSC: short far _setpixel( short x, short y )
  4886. %     MSC: short far _setpixel_w( double wx, double wy )
  4887.  
  4888.  
  4889.  - prototype in graph.h
  4890.  
  4891.  - returns previous value of pixel or -1 on error
  4892.  
  4893.  - Turbo C uses setpixel()
  4894.  - see  _getpixel
  4895.  
  4896. :_settextcolor
  4897. ^MSC: short far _settextcolor( short color )
  4898.  
  4899.  
  4900.  - prototype in graph.h
  4901.  
  4902.  - sets color of graphics text to color
  4903.  - default color is the highest valid color
  4904.  - returns previous color
  4905.  
  4906.  - see  _gettextcolor
  4907.  
  4908. :_settextposition
  4909. %MSC: struct rccoord far _settextposition( short row, short column )
  4910.  
  4911.  
  4912.  - prototype in graph.h
  4913.  
  4914.  - sets the current text position to that specified
  4915.  - returns previous text position in rccoord structure
  4916.  
  4917.  - see  _gettextposition
  4918.  
  4919. :_settextwindow
  4920. ^MSC: void far _settextwindow(short r1,short c1,short r2,short c2)
  4921.  
  4922.  
  4923.  - prototype in graph.h
  4924.  
  4925.  - sets graphics text output window;  text scrolls in window when
  4926.    the window becomes full
  4927.  - (r1,c1) upper left corner of window
  4928.  - (r2,c2) lower right corner of window
  4929.  
  4930.  
  4931. :settime
  4932. ^TC: void settime( struct time *timep )
  4933.  
  4934.  
  4935.  - prototype in dos.h
  4936.  
  4937.  - sets MS-DOS time via INT 21,2D
  4938.  - DOS 3.3+ also sets CMOS clock
  4939.  
  4940.  - MS C uses _dos_settime()
  4941.  - see  INT 21,2D
  4942.  
  4943. :setvbuf
  4944. ^int setvbuf( FILE *stream, char *buf, int type, size_t size )
  4945.  
  4946.  
  4947.  - prototype in stdio.h
  4948.  
  4949.  - causes buf to be used for I/O buffering instead of the auto-
  4950.    matically allocated buffer; used after given stream is opened
  4951.    and before output
  4952.  - in setvbuf, if buf is NULL, a buffer is allocated via malloc()
  4953.  - no I/O to the file should occur until after buffering is set
  4954.  
  4955.  - see SETBUF
  4956.  
  4957. :setvect
  4958. ^TC: void setvect( int intr_num, void interrupt(*isr)() )
  4959.  
  4960.  
  4961.  - prototype in dos.h
  4962.  
  4963.  - sets the value of interrupt vector named by intr_num
  4964.    (corresponds to 0-255 for MS-DOS) in DOS interrupt vector
  4965.    table to a far pointer to "isr" an interrupt service routine
  4966.  - address of a C routine may be used only if it has been
  4967.    declared to be an interrupt routine.  Ex:
  4968.  
  4969. ^void interrupt func( void );
  4970.  
  4971.  - MS C uses _dos_setvect()
  4972.  - see  INT 21,25
  4973.  
  4974.  
  4975. :setverify
  4976. ^TC: int setverify( int value )
  4977.  
  4978.  
  4979.  - prototype in dos.h
  4980.  
  4981.  - sets state of verify flag (0==off, 1==on) to value
  4982.  - no corresponding MS C function
  4983.  - see  INT 21,2E
  4984.  
  4985. :_setvideomode
  4986. ^MSC: short far _setvideomode( short mode )
  4987.  
  4988.  - prototype in graph.h
  4989.  
  4990.  - sets video mode specified
  4991.  - mode = _DEFAULTMODE   hardware default
  4992.           _MAXCOLORMODE  graphics mode with most colors
  4993.           _MAXRESMODE    graphics mode with highest resolution
  4994.           _TEXTBW40       40x25    16 color  CGA/Text
  4995.           _TEXTC40        40x25    16 color  CGA/Text
  4996.           _TEXTBW80       80x25    16 shades CGA/Text
  4997.           _TEXTC80        80x25    16 color  CGA/Text
  4998.           _MRES4COLOR    320x200    4 color  CGA/Graphics
  4999.           _MRESNOCOLOR   320x200    4 color  CGA/Graphics
  5000.           _HRESBW        640x200    2 color  CGA/Graphics
  5001.           _TEXTMONO       80x25        mono  MDA/Text
  5002.           _MRES16COLOR   320x200   16 color  EGA/Graphics
  5003.           _HRES16COLOR   640x200   16 color  EGA/Graphics
  5004.           _ERESNOCOLOR   640x350    1 color  EGA/Text
  5005.           _ERESCOLOR     640x350   64 color  EGA/Graphics
  5006.           _VRES2COLOR    640x480    2 color  VGA/Graphics
  5007.           _VRES16COLOR   640x480   16 color  VGA/Graphics
  5008.           _MRES256COLOR  320x200  256 color  VGA/Graphics
  5009.           _ORESCOLOR     640x400   16 color  CGA/Graphics/Olivetti
  5010.           _HERCMONO      720x348    2 color  HGC/Graphics/Hercules
  5011.  
  5012.  - returns non-zero on success; zero on error
  5013.  
  5014. :_setviewport
  5015. ^MSC: void far _setviewport( short x1, short y1, short x2, short y2 )
  5016.  
  5017.  
  5018.  - prototype in graph.h
  5019.  
  5020.  - defines a clipping region like _setcliprgn()
  5021.  - sets the logical origin to the upper left corner coordinates
  5022.    specified as parameters
  5023.  - (x1,y1) upper left corner of window
  5024.  - (x2,y2) lower right corner of window
  5025.  
  5026. :_setvisualpage
  5027. ^MSC: short far _setvisualpage( short page )
  5028.  
  5029.  
  5030.  - prototype in graph.h
  5031.  
  5032.  - sets visual page to that specified
  5033.  - default page is zero
  5034.  - returns previous page number or a negative value on error
  5035.  
  5036. :sin
  5037. ^double sin( double x )
  5038.  
  5039.  
  5040.  - prototype in math.h
  5041.  
  5042.  - returns sine of x
  5043.  - x must be in radians
  5044.  
  5045. :sinh
  5046. ^double sinh( double x )
  5047.  
  5048.  
  5049.  - prototype in math.h
  5050.  
  5051.  - returns hyperbolic sine of x
  5052.  - x must be in radians
  5053.  
  5054. :sleep
  5055. ^TC: void sleep( unsigned seconds )
  5056.  
  5057.  
  5058.  - prototype in dos.h
  5059.  
  5060.  - suspended program for seconds of time
  5061.  - accurate in seconds to limit of MS-DOS clock
  5062.  - no corresponding MS C function
  5063.  
  5064. :sopen
  5065. ^int sopen( const char *path, int access, int shflag, int mode )
  5066.  
  5067.  - prototype in io.h, also include share.h, stat.h & fcntl.h
  5068.  
  5069.  - actually a macro defined:  open( path, (access | shflag), mode )
  5070.  - opens file "path" and prepares it for shared I/O
  5071.  - sharing mode is determined using access, shflag and mode
  5072.  - access is a combination of the following ("permis" follows):
  5073.  
  5074. %  Read/Write Access Flags (mutually exclusive):
  5075.     O_RDONLY   open read only
  5076.     O_WRONLY   open write only
  5077.     O_RDWR     open read/write
  5078.  
  5079. %  Other Access Mode Flags:
  5080.     O_APPEND   file pointer is placed at EOF before each write
  5081.     O_CREAT    if file doesn't exist, create with "permis" attributes
  5082.     O_TRUNC    if exists, truncate length to zero, but leave file
  5083.                attributes unchanged
  5084.     O_BINARY   binary mode
  5085.     O_TEXT     text mode
  5086.     O_EXCL     used with O_CREAT, error occurs if file already exists
  5087.     O_NDELAY   UNIX only
  5088.  
  5089. %  Permission Attributes (if creating):
  5090.     S_IWRITE   write permission
  5091.     S_IREAD    read permission
  5092.     S_IREAD | S_IWRITE read/write permission
  5093.   
  5094.  - if O_BINARY nor O_TEXT is given, file is opened in translation
  5095.    mode (O_TEXT) given by global variable _fmode
  5096.  - returns non-negative number as file handle, or -1 on error
  5097. :spawn:spawn...
  5098. ^Function spawn(), etc...
  5099.  
  5100.  int spawnl( int mode, char *path, char *arg0,
  5101.              char *arg1, ..., NULL )
  5102.  int spawnle( int mode, char *path, char *arg0,
  5103.               char *arg1, ..., NULL, char *envp[] )
  5104.  int spawnlp( int mode, char *path, char *arg0,
  5105.               char *arg1, ..., NULL )
  5106.  int spawnlpe( int mode, char *path, char *arg0,
  5107.                char *arg1, ..., NULL, char *envp[] )
  5108.  int spawnv( int mode, char *path, char *argv )
  5109.  int spawnve( int mode, char *path, char *argv, char *envp[] )
  5110.  int spawnvp( int mode, char *path, char *argv )
  5111.  int spawnvpe( int mode, char *path, char *argv, char *envp[] )
  5112.  
  5113.  - prototype in process.h
  5114.  
  5115.  - creates & runs child processes
  5116.  - mode is P_WAIT which puts parent process "on hold" until child
  5117.    completes execution; P_NOWAIT which continues to run parent
  5118.    while child runs (not supported yet); or P_OVERLAY which overlays
  5119.    child in memory location formerly occupied by parent (same as
  5120.    exec... call)
  5121.  - use P_WAIT to perform a DOS shell
  5122.  - returns 0 for SUCCESS and non-zero for failure based on the
  5123.    errorlevel set by the application
  5124.  
  5125.  - see also exec...
  5126.  
  5127. :_splitpath
  5128. %MSC: void _splitpath( char *path, char *drive, char *dir,
  5129. %                      char *fname, char *ext )
  5130.  
  5131.  - prototype in stdlib.h
  5132.  
  5133.  - dissects the path into components
  5134.  - path = fully qualified file name to dissect
  5135.  - drive = is the drive letter followed by a colon if drive was
  5136.    specified in string
  5137.  - dir = any directories included in "path" plus '\'
  5138.  - fname = base filename w/o extension
  5139.  - ext = file extension
  5140.  - the maximum size of each component is: _MAX_DRIVE, _MAX_DIR,
  5141.    _MAX_FNAME, _MAX_EXT (all include the NULL and are actually
  5142.    much larger than needed, except _MAX_DRIVE is exact fit)
  5143.  
  5144.  - see  _makepath
  5145.  
  5146. :sprintf
  5147. ^int sprintf( char *s, const char *format [, arg1, arg2, ...] )
  5148.  
  5149.  
  5150.  - prototype in stdio.h
  5151.  
  5152.  - prints formatted data into string s
  5153.  
  5154.  
  5155.  - see  PRINTF SPEC  for format specifiers
  5156.  
  5157. :sqrt
  5158. ^double sqrt( double x )
  5159.  
  5160.  
  5161.  - prototype in math.h
  5162.  
  5163.  - returns square root of x, or 0 on error
  5164.  
  5165. :srand
  5166. ^void srand( unsigned seed )
  5167.  
  5168.  
  5169.  - prototype in stdlib.h
  5170.  
  5171.  - re-initializes the random number generator with seed
  5172.  - see rand()
  5173.  
  5174. :sscanf
  5175. ^int sscanf( const char *s, const char *format, arg1, arg2, ... )
  5176.  
  5177.  
  5178.  - prototype in stdio.h
  5179.  
  5180.  - see  SCANF  and  SCANF SPECS
  5181.  
  5182. :ssignal
  5183. ^int (*ssignal( int sig, int (*action)())) ()
  5184.  
  5185.  
  5186.  - prototype in signal.h
  5187.  
  5188.  - ssignal() and gsignal() implement a software-signaling facility
  5189.    where software signals are integers 1-15
  5190.  - ssignal() establishes an action routine for servicing a signal
  5191.    where sig is associated with the action routine
  5192.  - ssignal() returns action previously established for ssignal()
  5193.    or SIG_DFL
  5194.  - UNIX based
  5195.  
  5196. :stackavail
  5197. ^MSC: size_t stackavail( void )
  5198.  
  5199.  
  5200.  - prototype in malloc.h
  5201.  
  5202.  - used to determine approximate memory available on the stack for
  5203.    allocation via alloca()
  5204.  - returns approximate memory available on the stack
  5205.  
  5206.  - see  alloca
  5207.  
  5208. :stat
  5209. %      int stat( char *pathname, struct stat *buff )
  5210. %      int fstat( char *handle, struct stat *buff )
  5211.  
  5212.  
  5213.  - prototype in stat.h
  5214.  
  5215.  - stat() and fstat() store information about a given open file
  5216.    (or directory) in the stat structure (in stat.h)
  5217.  - stat() gets information about the open file or directory, while
  5218.    fstat() gets info about the open file associated with handle
  5219.  - returns 0 if successful, else -1 on error
  5220.  
  5221. :_status87
  5222. ^unsigned int _status87( void )
  5223.  
  5224.  
  5225.  - prototype in float.h
  5226.  
  5227.  - returns floating-point status word & other conditions detected
  5228.    by 8087/80287 exception handler
  5229.  - see float.h for definition of return word from _status87()
  5230.  
  5231. :stime
  5232. ^int stime( time_t *tp )
  5233.  
  5234.  
  5235.  - prototype in time.h
  5236.  
  5237.  - sets system time & date, where tp to value of time in seconds
  5238.    since 00:00:00 GMT Jan 1, 1970
  5239.  
  5240. :str...:strings
  5241. ^String Manipulation Functions
  5242.  
  5243.  - prototype in string.h (a few also exist in stdlib.h)
  5244.  
  5245. %Conversion:
  5246.  char  *strlwr( char *s )
  5247.  char  *strrev( char *s )
  5248.  double strtod( const char *s, char **endptr )
  5249.  long  strtol( const char *s, char **endptr, int radix )
  5250.  unsigned long strtoul( const char *s, char **endptr, int radix )
  5251.  char  *strupr( char *s )
  5252.  char  *strdup( const char *s )
  5253.  
  5254.  
  5255. %Search:
  5256.  char  *strchr( char *s, int c )
  5257.  size_t strcspn( const char *s1, const char *s2 )
  5258.  char  *strpbrk( const char *s1, const char *s2 )
  5259.  char  *strrchr( const char *s, int c )
  5260.  size_t strspn( const char *s1, const char *s2 )
  5261.  char  *strstr( const char *s1, const char *s2 )
  5262.  char  *strtok( char *s1, const char *s2 )
  5263.  
  5264.  
  5265. %Comparison:
  5266.  int strcmp( const char *s1, const char *s2 )
  5267.  int strcmpi( const char *s1, const char *s2 )
  5268.  int stricmp( const char *s1, const char *s2 )
  5269.  int strncmp( const char *s1, const char *s2, size_t maxlen )
  5270.  int strncmpi( const char *s1, const char *s2, size_t maxlen )
  5271.  int strnicmp( const char *s1, const char *s2, size_t maxlen )
  5272.  
  5273.  
  5274. %Copy:
  5275.  char *stpcpy( char *dest, const char *src )
  5276.  char *strcpy( char *dest, const char *src )
  5277.  char *strcat( char *dest, const char *src )
  5278.  char *strncat( char *dest, const char *src, size_t maxlen )
  5279.  char *strncpy( char *dest, const char *src, size_t maxlen )
  5280.  
  5281.  
  5282. %Miscellaneous:
  5283.  size_t strlen( const char *s )
  5284.  char  *strnset( char *s, int ch, size_t n )
  5285.  char  *strset( char *s, int ch )
  5286.  char  *strerror( int errnum )
  5287.  char  *_strerror( const char *s )
  5288.  
  5289. :stpcpy
  5290. ^char *stpcpy( char *dest, const char *src )
  5291.  
  5292.  
  5293.  - prototype in string.h
  5294.  
  5295.  - copies src into dest
  5296.  - returns dest+strlen(src)
  5297.  
  5298. :strcat
  5299. ^char *strcat( char *dest, const char *src )
  5300.  
  5301.  
  5302.  - prototype in string.h
  5303.  
  5304.  - appends src to dest
  5305.  
  5306. :strchr
  5307. ^char *strchr( const char *str, int c )
  5308.  
  5309.  
  5310.  - prototype in string.h
  5311.  
  5312.  - scans str for first occurrence of c
  5313.  - returns pointer to c in str, or NULL if not found
  5314.  
  5315. :strcmp
  5316. ^int strcmp( const char *str1, const char *str2 )
  5317.  
  5318.  
  5319.  - prototype in string.h
  5320.  
  5321.  - compares str1 to str2
  5322.  - returns < 0 if str1 < str2, = 0 if str1 = str2, or > 0
  5323.    if str1 > str2, using a signed comparison
  5324.  
  5325. :strcpy
  5326. ^char *strcpy( char *dest, const char *src )
  5327.  
  5328.  
  5329.  - prototype in string.h
  5330.  
  5331.  - copies src into dest
  5332.  - returns dest
  5333.  
  5334. :strcspn
  5335. ^size_t strcspn( const char *str1, const char *str2 )
  5336.  
  5337.  
  5338.  - prototype in string.h
  5339.  
  5340.  - returns length of initial segment of str1 that consists
  5341.    entirely of characters NOT from str2
  5342.  
  5343. :_strdate:_strtime
  5344. %           MSC: char *_strdate( char *date )
  5345. %           MSC: char *_strtime( char *time )
  5346.  
  5347.  
  5348.  - prototype in time.h
  5349.  
  5350.  - date = formatted date string: mm/dd/yy (9 bytes inc NULL)
  5351.  - time = formatted time string: hh:mm:ss (9 bytes inc NULL)
  5352.  - returns pointer to the parameter string
  5353.  
  5354.  - Turbo C uses strdate() and strtime()
  5355.  
  5356. :strdup
  5357. ^char *strdup( const char *str )
  5358.  
  5359.  
  5360.  - prototype in string.h
  5361.  
  5362.  - duplicates str, getting space with a call to malloc()
  5363.  - returns pointer to duplicated string, or NULL if space could not
  5364.    be allocated
  5365.  
  5366. :_strerror
  5367. ^MSC: char *_strerror( char *string )
  5368.  
  5369.  
  5370.  - prototype in string.h
  5371.  
  5372.  - creates an error message based on the user supplied string
  5373.    followed by a colon, then the library error message
  5374.  - string = user error message string
  5375.  - returns pointer to the generated string
  5376.  - does not print the string
  5377.  
  5378.  
  5379. :strerror
  5380. ^char *strerror( char *str )
  5381.  
  5382.  
  5383.  - prototype in string.h
  5384.  
  5385.  - str should contain your customized error message to which a system
  5386.    error message will be appended
  5387.  - allows you to generate customized error messages, returning a
  5388.    pointer to a null-terminated string containing an error message
  5389.  - if str is NULL, the return value contains the most recently
  5390.    generated system error message; this string is null-terminated
  5391.  - if str is not NULL, the return value contains, a colon, a space,
  5392.    the most recently generated system error message, and a newline;
  5393.    with length of str being 94 characters or less
  5394.  - this function generates the error string but does NOT print it
  5395.  - for accurate error-handling, strerror should be called as soon
  5396.    as a library routine generates an error return
  5397.  
  5398. :stricmp
  5399. ^int stricmp( const char *str1, const char *str2 )
  5400.  
  5401.  
  5402.  - prototype in string.h
  5403.  
  5404.  - compares str1 to str2 without case sensitivity
  5405.  
  5406.  - returns < 0 if str1 < str2
  5407.            = 0 if str1 = str2
  5408.            > 0 if str1 > str2
  5409.  
  5410.    using a signed comparison
  5411.  
  5412. :strlen
  5413. ^size_t strlen( const char *str )
  5414.  
  5415.  
  5416.  - prototype in string.h
  5417.  
  5418.  - returns number of characters in str, not counting the null
  5419.    terminating character
  5420.  
  5421. :strlwr
  5422. ^char *strlwr( char *str )
  5423.  
  5424.  
  5425.  - prototype in string.h
  5426.  
  5427.  - converts str to all lower case
  5428.  
  5429. :strncat
  5430. ^char *strncat( char *dest, const char *src, size_t maxlen )
  5431.  
  5432.  
  5433.  - prototype in string.h
  5434.  
  5435.  - appends up to maxlen characters of src to dest and then
  5436.    appends a null character
  5437.  
  5438. :strncmp
  5439. ^int strncmp( const char *str1, const char *str2, size_t maxlen )
  5440.  
  5441.  
  5442.  - prototype in string.h
  5443.  
  5444.  - compares str1 to str2 up to maxlen characters
  5445.  
  5446.  - returns < 0 if str1 < str2
  5447.            = 0 if str1 = str2
  5448.            > 0 if str1 > str2
  5449.  
  5450.    using a signed comparison
  5451.  
  5452. :strncpy
  5453. ^char *strncpy( char *dest, const char *src, size_t maxlen )
  5454.  
  5455.  
  5456.  - prototype in string.h
  5457.  
  5458.  - copies exactly maxlen characters from src to dest, truncating
  5459.    or null-padding dest
  5460.  - dest might NOT be null-terminated if length of src >= maxlen
  5461.  
  5462. :strnicmp
  5463. ^int strnicmp( const char *str1, const char *str2, size_t maxlen )
  5464.  
  5465.  
  5466.  - prototype in string.h
  5467.  
  5468.  - compares str1 to str2 up to maxlen chars ignoring case
  5469.  
  5470.  - returns < 0 if str1 < str2
  5471.            = 0 if str1 = str2
  5472.            > 0 if str1 > str2
  5473.  
  5474.    using a signed comparison
  5475.  
  5476. :strnset
  5477. ^char *strnset( char *str, int ch, size_t n )
  5478.  
  5479.  
  5480.  - prototype in string.h
  5481.  
  5482.  - sets up to first n bytes of str to ch
  5483.  - if n > strlen(str) then strlen(str) replaces n
  5484.  
  5485. :strpbrk
  5486. ^char *strpbrk( const char *str1, const char *str2 )
  5487.  
  5488.  
  5489.  - prototype in string.h
  5490.  
  5491.  - scans str1 for first occurrence of any character appearing in str2
  5492.  - returns pointer to first occurrence; NULL if not found
  5493.  
  5494. :strrchr
  5495. ^char *strrchr( const char *str, int c )
  5496.  
  5497.  
  5498.  - prototype in string.h
  5499.  
  5500.  - scans a string in reverse direction for specified character c
  5501.  - strrchr finds the LAST occurrence of c in str
  5502.  - returns pointer to LAST occurrence, or NULL if not found
  5503.  
  5504. :strrev
  5505. ^char *strrev( char *str )
  5506.  
  5507.  
  5508.  - prototype in string.h
  5509.  
  5510.  - reverses all characters in str, except null terminator
  5511.  
  5512. :strset
  5513. ^char *strset( char *str, int ch )
  5514.  
  5515.  
  5516.  - prototype in string.h
  5517.  
  5518.  - sets all characters in str to ch
  5519.  
  5520. :strspn
  5521. ^size_t strspn( const char *str1, const char *str2 )
  5522.  
  5523.  
  5524.  - prototype in string.h
  5525.  
  5526.  - returns length of initial segment of str1 that consists
  5527.    entirely of characters from str2
  5528.  
  5529. :strstr
  5530. ^char *strstr( const char *anchor, const char *testpattern )
  5531.  
  5532.  
  5533.  - prototype in string.h
  5534.  
  5535.  - returns a pointer within anchor where testpattern is found,
  5536.    or NULL if testpattern is not found in anchor
  5537.  - may be incompatible with Microsoft C
  5538.  
  5539. :strtod
  5540. ^double strtod( const char *str, char **endptr )
  5541.  
  5542.  
  5543.  - prototype in string.h
  5544.  
  5545.  - converts string str to a double value
  5546.  - stops reading at tfirst character that cannot be interpreted
  5547.    as part of a double value, returning in *endptr
  5548.  - str must have format:
  5549.  
  5550.    [ws][sn][ddd][.][ddd][fmt[sn]ddd]
  5551.  
  5552.    where [ws]  = optional whitespace
  5553.          [sn]  = optional sign (+-)
  5554.          [ddd] = optional digits
  5555.          [fmt] = option e or E
  5556.          [.]   = optional decimal point
  5557.  
  5558. :strtok
  5559. ^char *strtok( char *str1, const char *str2 )
  5560.  
  5561.  
  5562.  - prototype in string.h
  5563.  
  5564.  - parses str1 for tokens and separators, where separators are
  5565.    defined in str2
  5566.  - first call returns a pointer to the first character of the first
  5567.    token in str1 and writes a null character into str1 immediately
  5568.    following the returned token;   subsequent calls with NULL for
  5569.    the first argument will work through the string str1 in this way
  5570.    until no tokens remain
  5571.  - when tokens are exhausted, returns NULL
  5572.  
  5573. :strtol
  5574. ^long strtol( const char *str, char **endptr, int base )
  5575.  
  5576.  - prototype in string.h
  5577.  
  5578.  - converts string str to a long value
  5579.  - stops reading at first character that cannot be interpreted
  5580.    as part of a long value, returning in *endptr
  5581.  - str must have format:
  5582.  
  5583.    [ws][sn][0][x][ddd]
  5584.  
  5585.    where [ws]  = optional whitespace
  5586.          [sn]  = optional sign (+-)
  5587.          [0]   = optional zero
  5588.          [x]   = optional x or X
  5589.          [ddd] = optional digits
  5590.  
  5591.   - base is between 2 and 36; if 0, first few characters of str
  5592.     determines base to be used (oct,hex or dec) any other value
  5593.     of base is illegal
  5594. :strupr
  5595. ^char *strupr( char *str )
  5596.  
  5597.  
  5598.  - prototype in string.h
  5599.  
  5600.  - converts to all uppercase
  5601.  
  5602. :swab
  5603. ^void swab( char *src, char *dest, int nbytes )
  5604.  
  5605.  
  5606.  - prototype in stdlib.h
  5607.  
  5608.  - copies nbytes bytes from src into dest, with adjacent even and
  5609.    odd-byte positions being swapped
  5610.  - nbytes should therefore be an even number
  5611.  - a standard way of performing this is to use the XCHG instruction
  5612.  
  5613.  - see   XCHG
  5614. :system
  5615. ^int system( const char *command )
  5616.  
  5617.  
  5618.  - prototype in stdlib.h
  5619.  
  5620.  - invokes MS-DOS COMMAND.COM to execute "command", returning exit
  5621.    status of COMMAND.COM;  the COMSPEC environment variable is
  5622.    automatically searched if necessary
  5623.  - a CR/LF pair in the command string will result in an error
  5624.  - see also exec(), spawn()
  5625.  
  5626. :tan
  5627. ^double tan( double x )
  5628.  
  5629.  
  5630.  - prototype in math.h
  5631.  
  5632.  - returns tangent of x
  5633.  - x must be in radians
  5634.  
  5635. :tanh
  5636. ^double tanh( double x )
  5637.  
  5638.  
  5639.  - prototype in math.h
  5640.  
  5641.  - returns hyperbolic tangent of x
  5642.  - x must be in radians
  5643.  
  5644. :tell
  5645. ^long tell( int handle )
  5646.  
  5647.  
  5648.  - prototype in io.h
  5649.  
  5650.  - returns offset within file corresponding to handle
  5651.  - returns -1L on error
  5652.  
  5653.  - see   lseek
  5654. :tempnam:tmpnam
  5655. %     MSC: char *tempnam( char *dir, char *prefix )
  5656. %     MSC: char *tmpnam( char *string )
  5657.  
  5658.  
  5659.  - prototype in stdio.h
  5660.  
  5661.  - string = buffer to receive temporary filename
  5662.  - tempnam() creates a temporary file in the specified directory
  5663.    "dir" using the "prefix" as the beginning of the filename;
  5664.    memory for the resulting filename is allocate via malloc() and
  5665.    must be freed with free()
  5666.  - tmpnam() creates the temporary file in the current directory
  5667.  - return a pointer to the new name or NULL on error
  5668.  
  5669. :time
  5670. ^time_t time( time_t *tloc )
  5671.  
  5672.  
  5673.  - prototype in time.h
  5674.  
  5675.  - gives current time in seconds elapsed since 00:00:00 GMT,
  5676.    January 1, 1970, and stores it into tloc
  5677.  
  5678. :tmpfile
  5679. ^MSC: FILE *tmpfile( void )
  5680.  
  5681.  
  5682.  - prototype in stdio.h
  5683.  
  5684.  - creates and opens a temporary stream file
  5685.  - returns stream pointer or NULL on error
  5686.  - file is automatically deleted when closed or rmtmp() is called
  5687.  - rmtmp() works only if in original directory
  5688.  - file is opened in binary write mode; except MS C version 4.0
  5689.    opened file in write translate mode
  5690.  
  5691. :toascii
  5692. ^int toascii( int c )
  5693.  
  5694.  
  5695.  - prototype in ctype.h
  5696.  
  5697.  - clears all but lower 7 bits in c, converting to ASCII
  5698.  
  5699. :_tolower
  5700. ^int _tolower( int c )
  5701.  
  5702.  
  5703.  - prototype in ctype.h
  5704.  
  5705.  - converts c to lowercase if c is UPPER case
  5706.  - use tolower() preferentially
  5707.  
  5708. :tolower
  5709. ^int tolower( int c )
  5710.  
  5711.  
  5712.  - prototype in ctype.h
  5713.  
  5714.  - converts c to LOWER case only if c is UPPER case
  5715.  
  5716. :_toupper
  5717. ^int _toupper( int c )
  5718.  
  5719.  
  5720.  - prototype in ctype.h
  5721.  
  5722.  - converts c to UPPER case only if c is  LOWER case
  5723.  - use toupper() preferentially
  5724.  
  5725. :toupper
  5726. ^int toupper( int c )
  5727.  
  5728.  
  5729.  - prototype in ctype.h
  5730.  
  5731.  - converts c to UPPER case only if c is  LOWER case
  5732.  
  5733. :tzset
  5734. ^void tzset( void )
  5735.  
  5736.  
  5737.  - prototype in time.h
  5738.  
  5739.  - included for UNIX compatibility but does nothing in DOS
  5740.  
  5741. :ultoa
  5742. ^char *ultoa( unsigned long value, char *string, int radix )
  5743.  
  5744.  
  5745.  - prototype in stdlib.h
  5746.  
  5747.  - converts value to string where radix specifies base
  5748.    (2-36) for conversion
  5749.  
  5750. :umask
  5751. ^MSC: int umask( int permission )
  5752.  
  5753.  
  5754.  - prototype in io.h, sys\types.h, sys\stat.h
  5755.  
  5756.  - changes permision in which a file may be accessed
  5757.  - permission = S_IWRITE  write is forbidden
  5758.               = S_IREAD   read is forbidden  (ignored by DOS)
  5759.               = S_IWRITE | S_IREAD  no reading or writing
  5760.  
  5761.  - returns previous permission value
  5762.  
  5763. :ungetc
  5764. ^int ungetc( int c, FILE *fd )
  5765.  
  5766.  
  5767.  - prototype in stdio.h
  5768.  
  5769.  - pushes character back into file stream
  5770.  
  5771. :ungetch
  5772. ^void ungetch( int c )
  5773.  
  5774.  
  5775.  - prototype in conio.h
  5776.  
  5777.  - similar to ungetc() except pushes character back to keyboard buffer
  5778.  
  5779. :unixtodos
  5780. %TC: void unixtodos( long utime, struct date *dateptr,
  5781. %                    struct time *timeptr)
  5782.  
  5783.  
  5784.  - prototype in dos.h
  5785.  
  5786.  - converts date & time to DOS format
  5787.  - no corresponding MS C function
  5788.  
  5789. :unlink
  5790. ^int unlink( const char *filename )
  5791.  
  5792.  
  5793.  - prototype in dos.h or io.h
  5794.  
  5795.  - returns 0 if successful, else -1
  5796.  
  5797. :unlock
  5798. ^TC: int unlock( int handle, long offset, long length )
  5799.  
  5800.  
  5801.  - prototype in io.h
  5802.  
  5803.  - unlock() removes locks placed on a file region by lock()
  5804.  - returns 0 on success, else -1 on error
  5805.  - all locks must be released before program termination
  5806.  - MS C uses locking()
  5807.  - see also lock
  5808.  
  5809. :utime
  5810. ^MSC: int utime( char *path, struct utimbuf *times )
  5811.  
  5812.  
  5813.  - prototype in sys\types.h, sys\utime.h
  5814.  
  5815.  - path = any valid DOS filename
  5816.  - times = time values in structure (modtime should be set)
  5817.  - if write access to the file is available the file time is updated
  5818.    from the modtime field
  5819.  - if times is NULL the file date is set to current time
  5820.  - returns 0 on success or -1 on error
  5821.  
  5822.  struct utimbuf
  5823.     {
  5824.     time_t actime;   /* access time (not used in DOS) */
  5825.     time_t modtime;  /* modification time */
  5826.     };
  5827.  
  5828. :vfprintf
  5829. ^int vfprintf( FILE *stream, const char *format, va_list param )
  5830.  
  5831.  
  5832.  - prototype in stdio.h
  5833.  
  5834.  - sends formatted output to a stream
  5835.  
  5836. :vfscanf
  5837. ^int vfscanf( FILE *stream, const char *format, va_list argp )
  5838.  
  5839.  
  5840.  - prototype in stdio.h
  5841.  
  5842.  - like fscanf(), except arguments accepted from va_arg array from
  5843.    va_list parm
  5844.  
  5845. :vprintf
  5846. ^int vprintf( const char *format, va_list param )
  5847.  
  5848.  
  5849.  - prototype in stdio.h
  5850.  
  5851.  - sends formatted output to stdout
  5852.  
  5853. :vscanf
  5854. ^int vscanf( const char *format, va_list argp )
  5855.  
  5856.  
  5857.  - prototype in stdio.h
  5858.  
  5859.  - like scanf(), except arguments accepted from va_arg array from
  5860.    va_list parm
  5861.  
  5862. :vsprintf
  5863. ^int vsprintf( char *string, const char *format, va_list param )
  5864.  
  5865.  
  5866.  - prototype in stdio.h
  5867.  
  5868.  - sends formatted output to a string
  5869.  
  5870. :vsscanf
  5871. %int vsscanf( const char *string, const char *format, va_list argp )
  5872.  
  5873.  
  5874.  - prototype in stdio.h
  5875.  
  5876.  - like sscanf(), except arguments accepted from va_list parm
  5877.  
  5878. :_wrapon
  5879. ^MSC: short far _wrapon( short wrap )
  5880.  
  5881.  
  5882.  - prototype in graph.h
  5883.  
  5884.  - sets wrapping/truncating of text
  5885.  - wrap = _GWRAPOFF truncates text at window border
  5886.         = _GWRAPON  wraps line at window border
  5887.  
  5888.  - returns previous wrap value
  5889.  
  5890. :_write
  5891. ^TC: int _write( int fd, char *buf, int count )
  5892.  
  5893.  
  5894.  - prototype in io.h
  5895.  
  5896.  - writes count bytes from buf to file or device at fd
  5897.  - count cannot be greater that 65534
  5898.  - is a direct call to MS-DOS write function INT 21,40
  5899.  - does NO conversion of CR/LFs; all output is binary
  5900.  - returns a count of bytes written  or -1 on error
  5901.  - MS C uses _dos_write()
  5902.  
  5903.  - see   write   _open   _creat   _read   INT 21,40
  5904.  
  5905. :write
  5906. ^int write( int fd, char *buf, int count )
  5907.  
  5908.  
  5909.  - prototype in io.h
  5910.  
  5911.  - write count bytes from buf to file or device at fd
  5912.  - converts LF to CR-LF for text output
  5913.  - returns a count of bytes written (excluding any CRs
  5914.    generated for a text file), or -1 on error
  5915.